I am encountering an issue in SOFiSTiK Teddy where two mathematically equivalent programs produce different results. Here are the two programs:
Program 1:
let#AbstUnteElem DIV(#SpglAufl_PosU(#AbstHaltNr)/((#Hoehe(#1+2)-#Hoehe(#1+1))/#VER))+IIF(MOD(#SpglAufl_PosU(#AbstHaltNr)/((#Hoehe(#1+2)-#Hoehe(#1+1))/#VER))>=0.5,1,0)
sto#SpglHoehe(#1+1) #Hoehe(#1+2)-#AbstUnteElem*((#Hoehe(#1+2)-#Hoehe(#1+1))/#VER)
let#Rad (#Durchm(#1+1)+(#SpglHoehe(#1+1)-#Hoehe(#1+1))((#Durchm(#1+2)-#Durchm(#1+1))/(#Hoehe(#1+2)-#Hoehe(#1+1))))/2
let#Dic (#Dicke(#1+1)+(#SpglHoehe(#1+1)-#Hoehe(#1+1))((#Dicke(#1+2)-#Dicke(#1+1))/(#Hoehe(#1+2)-#Hoehe(#1+1))))
sto#SpglRadius(#1+1) #Rad-#Dic-#SpanngHullroDurc/2-#SpglAufl_Abst(#AbstHaltNr) ;
Program 2:
let#AbstUnteElem DIV(#SpglAufl_PosU(#AbstHaltNr)/((#Hoehe(#1+2)-#Hoehe(#1+1))/#VER))+IIF(MOD(#SpglAufl_PosU(#AbstHaltNr)/((#Hoehe(#1+2)-#Hoehe(#1+1))/#VER))>=0.5,1,0)
sto#SpglHoehe(#1+1) #Hoehe(#1+2)-#AbstUnteElem*((#Hoehe(#1+2)-#Hoehe(#1+1))/#VER)
sto#SpglRadius(#1+1) (#Durchm(#1+1)+(#SpglHoehe(#1+1)-#Hoehe(#1+1))((#Durchm(#1+2)-#Durchm(#1+1))/(#Hoehe(#1+2)-#Hoehe(#1+1))))/2 $$
-(#Dicke(#1+1)+(#SpglHoehe(#1+1)-#Hoehe(#1+1))((#Dicke(#1+2)-#Dicke(#1+1))/(#Hoehe(#1+2)-#Hoehe(#1+1)))) $$
-#SpanngHullroDurc/2 $$
-#SpglAufl_Abst(#AbstHaltNr) ;
Despite the mathematical equivalence of these programs, SOFiSTiK produces different results.
Could someone help explain why this discrepancy occurs and if there are any specific considerations or best practices we should follow when programming in SOFiSTiK Teddy?
Thank you in advance for your assistance!