
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* eh (/ (tan t) (- ew)))))) (fabs (fma ew (* (cos t_1) (- (cos t))) (* eh (* (sin t) (sin t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh * (tan(t) / -ew)));
return fabs(fma(ew, (cos(t_1) * -cos(t)), (eh * (sin(t) * sin(t_1)))));
}
function code(eh, ew, t) t_1 = atan(Float64(eh * Float64(tan(t) / Float64(-ew)))) return abs(fma(ew, Float64(cos(t_1) * Float64(-cos(t))), Float64(eh * Float64(sin(t) * sin(t_1))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(ew * N[(N[Cos[t$95$1], $MachinePrecision] * (-N[Cos[t], $MachinePrecision])), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\\
\left|\mathsf{fma}\left(ew, \cos t\_1 \cdot \left(-\cos t\right), eh \cdot \left(\sin t \cdot \sin t\_1\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* eh (tan t)) (- ew))))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh * tan(t)) / -ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((eh * tan(t)) / -ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh * Math.tan(t)) / -ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh * math.tan(t)) / -ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew))) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh * tan(t)) / -ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (fma ew (pow (cbrt (cos t)) 3.0) (* eh (* (sin t) (sin (atan (* eh (/ (tan t) (- ew))))))))))
double code(double eh, double ew, double t) {
return fabs(fma(ew, pow(cbrt(cos(t)), 3.0), (eh * (sin(t) * sin(atan((eh * (tan(t) / -ew))))))));
}
function code(eh, ew, t) return abs(fma(ew, (cbrt(cos(t)) ^ 3.0), Float64(eh * Float64(sin(t) * sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))))))) end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Power[N[Power[N[Cos[t], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(ew, {\left(\sqrt[3]{\cos t}\right)}^{3}, eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)\right)\right)\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr98.6%
Taylor expanded in eh around 0 98.6%
Final simplification98.6%
(FPCore (eh ew t)
:precision binary64
(fabs
(*
ew
(-
(cos t)
(/ (* (* eh (sin t)) (sin (atan (* (tan t) (/ eh (- ew)))))) ew)))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) - (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * (cos(t) - (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) - (((eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew))))) / ew))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) - (((eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / -ew))))) / ew))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) - Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew)))))) / ew)))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) - (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew)))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] - N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t - \frac{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr98.6%
Taylor expanded in ew around inf 92.8%
associate-*r*92.8%
associate-*r/92.8%
neg-mul-192.8%
distribute-lft-neg-out92.8%
distribute-lft-neg-out92.8%
distribute-frac-neg92.8%
*-commutative92.8%
associate-*r/92.8%
distribute-rgt-neg-in92.8%
Simplified92.8%
add-sqr-sqrt39.9%
sqrt-unprod73.3%
sqr-neg73.3%
sqrt-unprod52.8%
add-sqr-sqrt92.8%
distribute-lft-neg-in92.8%
neg-sub092.8%
Applied egg-rr92.8%
neg-sub092.8%
distribute-rgt-neg-in92.8%
Simplified92.8%
Final simplification92.8%
(FPCore (eh ew t)
:precision binary64
(fabs
(*
ew
(+
(cos t)
(/ (* (* eh (sin t)) (sin (atan (* (tan t) (/ eh (- ew)))))) ew)))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) + (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * (cos(t) + (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) + (((eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew))))) / ew))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) + (((eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / -ew))))) / ew))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) + Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew)))))) / ew)))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) + (((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))) / ew)))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t + \frac{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr98.6%
Taylor expanded in ew around inf 92.8%
associate-*r*92.8%
associate-*r/92.8%
neg-mul-192.8%
distribute-lft-neg-out92.8%
distribute-lft-neg-out92.8%
distribute-frac-neg92.8%
*-commutative92.8%
associate-*r/92.8%
distribute-rgt-neg-in92.8%
Simplified92.8%
Final simplification92.8%
(FPCore (eh ew t)
:precision binary64
(fabs
(*
ew
(+
(cos t)
(* (* eh (sin t)) (/ (sin (- (atan (* (tan t) (/ eh ew))))) ew))))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) + ((eh * sin(t)) * (sin(-atan((tan(t) * (eh / ew)))) / ew)))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * (cos(t) + ((eh * sin(t)) * (sin(-atan((tan(t) * (eh / ew)))) / ew)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) + ((eh * Math.sin(t)) * (Math.sin(-Math.atan((Math.tan(t) * (eh / ew)))) / ew)))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) + ((eh * math.sin(t)) * (math.sin(-math.atan((math.tan(t) * (eh / ew)))) / ew)))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) + Float64(Float64(eh * sin(t)) * Float64(sin(Float64(-atan(Float64(tan(t) * Float64(eh / ew))))) / ew))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) + ((eh * sin(t)) * (sin(-atan((tan(t) * (eh / ew)))) / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[(-N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t + \left(eh \cdot \sin t\right) \cdot \frac{\sin \left(-\tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr98.6%
Taylor expanded in ew around inf 92.8%
associate-*r*92.8%
associate-*r/92.8%
neg-mul-192.8%
distribute-lft-neg-out92.8%
distribute-lft-neg-out92.8%
distribute-frac-neg92.8%
*-commutative92.8%
associate-*r/92.8%
distribute-rgt-neg-in92.8%
Simplified92.8%
associate-/l*92.8%
distribute-rgt-neg-out92.8%
atan-neg92.8%
Applied egg-rr92.8%
(FPCore (eh ew t)
:precision binary64
(fabs
(*
ew
(+
(cos t)
(* eh (* (sin t) (/ (sin (atan (* eh (/ (tan t) (- ew))))) ew)))))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) + (eh * (sin(t) * (sin(atan((eh * (tan(t) / -ew)))) / ew))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * (cos(t) + (eh * (sin(t) * (sin(atan((eh * (tan(t) / -ew)))) / ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) + (eh * (Math.sin(t) * (Math.sin(Math.atan((eh * (Math.tan(t) / -ew)))) / ew))))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) + (eh * (math.sin(t) * (math.sin(math.atan((eh * (math.tan(t) / -ew)))) / ew))))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) + Float64(eh * Float64(sin(t) * Float64(sin(atan(Float64(eh * Float64(tan(t) / Float64(-ew))))) / ew)))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) + (eh * (sin(t) * (sin(atan((eh * (tan(t) / -ew)))) / ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t + eh \cdot \left(\sin t \cdot \frac{\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{-ew}\right)}{ew}\right)\right)\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr98.6%
Taylor expanded in ew around inf 92.8%
associate-/l*92.7%
associate-/l*92.7%
associate-*r/92.7%
neg-mul-192.7%
distribute-lft-neg-out92.7%
associate-/l*92.7%
distribute-lft-neg-in92.7%
distribute-rgt-neg-in92.7%
Simplified92.7%
Final simplification92.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (atan (* eh (/ (tan t) ew))))) (t_2 (fabs (* ew (cos t)))))
(if (<= ew -5e-124)
t_2
(if (<= ew 9.5e-189)
(fabs (* (* eh (sin t)) t_1))
(if (<= ew 1.8e-17)
(* ew (+ (cos t) (* eh (/ (* (sin t) t_1) ew))))
t_2)))))
double code(double eh, double ew, double t) {
double t_1 = sin(atan((eh * (tan(t) / ew))));
double t_2 = fabs((ew * cos(t)));
double tmp;
if (ew <= -5e-124) {
tmp = t_2;
} else if (ew <= 9.5e-189) {
tmp = fabs(((eh * sin(t)) * t_1));
} else if (ew <= 1.8e-17) {
tmp = ew * (cos(t) + (eh * ((sin(t) * t_1) / ew)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sin(atan((eh * (tan(t) / ew))))
t_2 = abs((ew * cos(t)))
if (ew <= (-5d-124)) then
tmp = t_2
else if (ew <= 9.5d-189) then
tmp = abs(((eh * sin(t)) * t_1))
else if (ew <= 1.8d-17) then
tmp = ew * (cos(t) + (eh * ((sin(t) * t_1) / ew)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(Math.atan((eh * (Math.tan(t) / ew))));
double t_2 = Math.abs((ew * Math.cos(t)));
double tmp;
if (ew <= -5e-124) {
tmp = t_2;
} else if (ew <= 9.5e-189) {
tmp = Math.abs(((eh * Math.sin(t)) * t_1));
} else if (ew <= 1.8e-17) {
tmp = ew * (Math.cos(t) + (eh * ((Math.sin(t) * t_1) / ew)));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(math.atan((eh * (math.tan(t) / ew)))) t_2 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -5e-124: tmp = t_2 elif ew <= 9.5e-189: tmp = math.fabs(((eh * math.sin(t)) * t_1)) elif ew <= 1.8e-17: tmp = ew * (math.cos(t) + (eh * ((math.sin(t) * t_1) / ew))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = sin(atan(Float64(eh * Float64(tan(t) / ew)))) t_2 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -5e-124) tmp = t_2; elseif (ew <= 9.5e-189) tmp = abs(Float64(Float64(eh * sin(t)) * t_1)); elseif (ew <= 1.8e-17) tmp = Float64(ew * Float64(cos(t) + Float64(eh * Float64(Float64(sin(t) * t_1) / ew)))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(atan((eh * (tan(t) / ew)))); t_2 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -5e-124) tmp = t_2; elseif (ew <= 9.5e-189) tmp = abs(((eh * sin(t)) * t_1)); elseif (ew <= 1.8e-17) tmp = ew * (cos(t) + (eh * ((sin(t) * t_1) / ew))); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -5e-124], t$95$2, If[LessEqual[ew, 9.5e-189], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.8e-17], N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(eh * N[(N[(N[Sin[t], $MachinePrecision] * t$95$1), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
t_2 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -5 \cdot 10^{-124}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 9.5 \cdot 10^{-189}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot t\_1\right|\\
\mathbf{elif}\;ew \leq 1.8 \cdot 10^{-17}:\\
\;\;\;\;ew \cdot \left(\cos t + eh \cdot \frac{\sin t \cdot t\_1}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -5.0000000000000003e-124 or 1.79999999999999997e-17 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.1%
pow399.1%
Applied egg-rr98.8%
unpow398.8%
add-cube-cbrt99.4%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in ew around inf 83.7%
if -5.0000000000000003e-124 < ew < 9.499999999999999e-189Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
log1p-expm1-u99.8%
sin-atan52.6%
sin-atan99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
add-sqr-sqrt56.8%
sqrt-unprod89.6%
sqr-neg89.6%
sqrt-unprod42.4%
add-sqr-sqrt99.2%
Applied egg-rr99.2%
Taylor expanded in ew around 0 80.5%
associate-*r*80.5%
associate-/l*80.5%
Simplified80.5%
if 9.499999999999999e-189 < ew < 1.79999999999999997e-17Initial program 99.7%
Applied egg-rr86.1%
Taylor expanded in ew around inf 79.3%
associate-/l*79.3%
associate-/l*79.3%
Simplified79.3%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -8.6e-123) (not (<= ew 3e-97))) (fabs (* ew (cos t))) (fabs (* (* eh (sin t)) (sin (atan (* eh (/ (tan t) ew))))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -8.6e-123) || !(ew <= 3e-97)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs(((eh * sin(t)) * sin(atan((eh * (tan(t) / ew))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-8.6d-123)) .or. (.not. (ew <= 3d-97))) then
tmp = abs((ew * cos(t)))
else
tmp = abs(((eh * sin(t)) * sin(atan((eh * (tan(t) / ew))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -8.6e-123) || !(ew <= 3e-97)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((eh * (Math.tan(t) / ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -8.6e-123) or not (ew <= 3e-97): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan((eh * (math.tan(t) / ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -8.6e-123) || !(ew <= 3e-97)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(eh * Float64(tan(t) / ew)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -8.6e-123) || ~((ew <= 3e-97))) tmp = abs((ew * cos(t))); else tmp = abs(((eh * sin(t)) * sin(atan((eh * (tan(t) / ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -8.6e-123], N[Not[LessEqual[ew, 3e-97]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -8.6 \cdot 10^{-123} \lor \neg \left(ew \leq 3 \cdot 10^{-97}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right|\\
\end{array}
\end{array}
if ew < -8.60000000000000064e-123 or 3.00000000000000024e-97 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.1%
pow399.1%
Applied egg-rr98.6%
unpow398.6%
add-cube-cbrt99.2%
clear-num99.2%
Applied egg-rr99.2%
Taylor expanded in ew around inf 81.4%
if -8.60000000000000064e-123 < ew < 3.00000000000000024e-97Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
log1p-expm1-u99.8%
sin-atan55.8%
sin-atan99.8%
associate-*r/99.8%
*-commutative99.8%
associate-/l*99.8%
add-sqr-sqrt54.9%
sqrt-unprod91.5%
sqr-neg91.5%
sqrt-unprod44.5%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
Taylor expanded in ew around 0 78.8%
associate-*r*78.8%
associate-/l*78.8%
Simplified78.8%
Final simplification80.7%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (+ (cos t) (* (* eh (sin t)) (/ (sin (- (atan (/ (* eh t) ew)))) ew))))))
double code(double eh, double ew, double t) {
return fabs((ew * (cos(t) + ((eh * sin(t)) * (sin(-atan(((eh * t) / ew))) / ew)))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * (cos(t) + ((eh * sin(t)) * (sin(-atan(((eh * t) / ew))) / ew)))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * (Math.cos(t) + ((eh * Math.sin(t)) * (Math.sin(-Math.atan(((eh * t) / ew))) / ew)))));
}
def code(eh, ew, t): return math.fabs((ew * (math.cos(t) + ((eh * math.sin(t)) * (math.sin(-math.atan(((eh * t) / ew))) / ew)))))
function code(eh, ew, t) return abs(Float64(ew * Float64(cos(t) + Float64(Float64(eh * sin(t)) * Float64(sin(Float64(-atan(Float64(Float64(eh * t) / ew)))) / ew))))) end
function tmp = code(eh, ew, t) tmp = abs((ew * (cos(t) + ((eh * sin(t)) * (sin(-atan(((eh * t) / ew))) / ew))))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[(N[Cos[t], $MachinePrecision] + N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[(-N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision])], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \left(\cos t + \left(eh \cdot \sin t\right) \cdot \frac{\sin \left(-\tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right)}{ew}\right)\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr98.6%
Taylor expanded in ew around inf 92.8%
associate-*r*92.8%
associate-*r/92.8%
neg-mul-192.8%
distribute-lft-neg-out92.8%
distribute-lft-neg-out92.8%
distribute-frac-neg92.8%
*-commutative92.8%
associate-*r/92.8%
distribute-rgt-neg-in92.8%
Simplified92.8%
associate-/l*92.8%
distribute-rgt-neg-out92.8%
atan-neg92.8%
Applied egg-rr92.8%
Taylor expanded in t around 0 92.7%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -1.9e-5) (not (<= t 6.5e-7))) (fabs (* ew (cos t))) (fabs (+ ew (* (sin (atan (* (tan t) (/ eh (- ew))))) (* eh t))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -1.9e-5) || !(t <= 6.5e-7)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((ew + (sin(atan((tan(t) * (eh / -ew)))) * (eh * t))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.9d-5)) .or. (.not. (t <= 6.5d-7))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((ew + (sin(atan((tan(t) * (eh / -ew)))) * (eh * t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -1.9e-5) || !(t <= 6.5e-7)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((ew + (Math.sin(Math.atan((Math.tan(t) * (eh / -ew)))) * (eh * t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -1.9e-5) or not (t <= 6.5e-7): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((ew + (math.sin(math.atan((math.tan(t) * (eh / -ew)))) * (eh * t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -1.9e-5) || !(t <= 6.5e-7)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(ew + Float64(sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))) * Float64(eh * t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -1.9e-5) || ~((t <= 6.5e-7))) tmp = abs((ew * cos(t))); else tmp = abs((ew + (sin(atan((tan(t) * (eh / -ew)))) * (eh * t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -1.9e-5], N[Not[LessEqual[t, 6.5e-7]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew + N[(N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-5} \lor \neg \left(t \leq 6.5 \cdot 10^{-7}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew + \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\end{array}
\end{array}
if t < -1.9000000000000001e-5 or 6.50000000000000024e-7 < t Initial program 99.6%
fabs-sub99.6%
sub-neg99.6%
+-commutative99.6%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
fma-define99.6%
Simplified99.6%
add-cube-cbrt98.7%
pow398.7%
Applied egg-rr98.3%
unpow398.3%
add-cube-cbrt99.2%
clear-num99.1%
Applied egg-rr99.1%
Taylor expanded in ew around inf 54.6%
if -1.9000000000000001e-5 < t < 6.50000000000000024e-7Initial program 100.0%
fabs-sub100.0%
sub-neg100.0%
+-commutative100.0%
associate-*l*100.0%
distribute-rgt-neg-in100.0%
fma-define100.0%
Simplified100.0%
add-cube-cbrt100.0%
pow3100.0%
Applied egg-rr98.9%
Taylor expanded in t around 0 98.8%
associate-*r*98.8%
associate-*r/98.8%
neg-mul-198.8%
distribute-lft-neg-out98.8%
distribute-lft-neg-out98.8%
distribute-frac-neg98.8%
*-commutative98.8%
associate-*r/98.8%
distribute-rgt-neg-in98.8%
Simplified98.8%
Final simplification76.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))) (t_2 (* eh (sin t))))
(if (<= ew -2e-125)
t_1
(if (<= ew -1.9e-297)
(* t_2 (- (sin (atan (* eh (/ (tan t) ew))))))
(if (<= ew 1.38e-99) (* t_2 (sin (atan (/ (* eh t) ew)))) t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double t_2 = eh * sin(t);
double tmp;
if (ew <= -2e-125) {
tmp = t_1;
} else if (ew <= -1.9e-297) {
tmp = t_2 * -sin(atan((eh * (tan(t) / ew))));
} else if (ew <= 1.38e-99) {
tmp = t_2 * sin(atan(((eh * t) / ew)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = abs((ew * cos(t)))
t_2 = eh * sin(t)
if (ew <= (-2d-125)) then
tmp = t_1
else if (ew <= (-1.9d-297)) then
tmp = t_2 * -sin(atan((eh * (tan(t) / ew))))
else if (ew <= 1.38d-99) then
tmp = t_2 * sin(atan(((eh * t) / ew)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.cos(t)));
double t_2 = eh * Math.sin(t);
double tmp;
if (ew <= -2e-125) {
tmp = t_1;
} else if (ew <= -1.9e-297) {
tmp = t_2 * -Math.sin(Math.atan((eh * (Math.tan(t) / ew))));
} else if (ew <= 1.38e-99) {
tmp = t_2 * Math.sin(Math.atan(((eh * t) / ew)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) t_2 = eh * math.sin(t) tmp = 0 if ew <= -2e-125: tmp = t_1 elif ew <= -1.9e-297: tmp = t_2 * -math.sin(math.atan((eh * (math.tan(t) / ew)))) elif ew <= 1.38e-99: tmp = t_2 * math.sin(math.atan(((eh * t) / ew))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) t_2 = Float64(eh * sin(t)) tmp = 0.0 if (ew <= -2e-125) tmp = t_1; elseif (ew <= -1.9e-297) tmp = Float64(t_2 * Float64(-sin(atan(Float64(eh * Float64(tan(t) / ew)))))); elseif (ew <= 1.38e-99) tmp = Float64(t_2 * sin(atan(Float64(Float64(eh * t) / ew)))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * cos(t))); t_2 = eh * sin(t); tmp = 0.0; if (ew <= -2e-125) tmp = t_1; elseif (ew <= -1.9e-297) tmp = t_2 * -sin(atan((eh * (tan(t) / ew)))); elseif (ew <= 1.38e-99) tmp = t_2 * sin(atan(((eh * t) / ew))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, -2e-125], t$95$1, If[LessEqual[ew, -1.9e-297], N[(t$95$2 * (-N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[ew, 1.38e-99], N[(t$95$2 * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
t_2 := eh \cdot \sin t\\
\mathbf{if}\;ew \leq -2 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq -1.9 \cdot 10^{-297}:\\
\;\;\;\;t\_2 \cdot \left(-\sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\right)\\
\mathbf{elif}\;ew \leq 1.38 \cdot 10^{-99}:\\
\;\;\;\;t\_2 \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -2.00000000000000002e-125 or 1.38e-99 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.1%
pow399.1%
Applied egg-rr98.6%
unpow398.6%
add-cube-cbrt99.2%
clear-num99.2%
Applied egg-rr99.2%
Taylor expanded in ew around inf 81.4%
if -2.00000000000000002e-125 < ew < -1.90000000000000002e-297Initial program 99.7%
Applied egg-rr23.5%
Taylor expanded in eh around inf 24.1%
associate-*r*24.1%
*-commutative24.1%
associate-*r/24.1%
associate-*r/24.1%
*-commutative24.1%
associate-*r/24.1%
Simplified24.1%
add-sqr-sqrt34.4%
sqrt-unprod58.3%
sqr-neg58.3%
sqrt-unprod50.4%
add-sqr-sqrt84.9%
distribute-lft-neg-in84.9%
neg-sub084.9%
Applied egg-rr57.9%
neg-sub084.9%
distribute-rgt-neg-in84.9%
Simplified57.9%
if -1.90000000000000002e-297 < ew < 1.38e-99Initial program 99.9%
Applied egg-rr73.4%
Taylor expanded in eh around inf 55.8%
associate-*r*55.8%
*-commutative55.8%
associate-*r/55.8%
associate-*r/55.8%
*-commutative55.8%
associate-*r/55.8%
Simplified55.8%
Taylor expanded in t around 0 65.6%
Final simplification76.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= ew -4.1e-203) (not (<= ew 1.4e-99))) (fabs (* ew (cos t))) (* (* eh (sin t)) (sin (atan (/ (* eh t) ew))))))
double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -4.1e-203) || !(ew <= 1.4e-99)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = (eh * sin(t)) * sin(atan(((eh * t) / ew)));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((ew <= (-4.1d-203)) .or. (.not. (ew <= 1.4d-99))) then
tmp = abs((ew * cos(t)))
else
tmp = (eh * sin(t)) * sin(atan(((eh * t) / ew)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((ew <= -4.1e-203) || !(ew <= 1.4e-99)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = (eh * Math.sin(t)) * Math.sin(Math.atan(((eh * t) / ew)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (ew <= -4.1e-203) or not (ew <= 1.4e-99): tmp = math.fabs((ew * math.cos(t))) else: tmp = (eh * math.sin(t)) * math.sin(math.atan(((eh * t) / ew))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((ew <= -4.1e-203) || !(ew <= 1.4e-99)) tmp = abs(Float64(ew * cos(t))); else tmp = Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * t) / ew)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((ew <= -4.1e-203) || ~((ew <= 1.4e-99))) tmp = abs((ew * cos(t))); else tmp = (eh * sin(t)) * sin(atan(((eh * t) / ew))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[ew, -4.1e-203], N[Not[LessEqual[ew, 1.4e-99]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4.1 \cdot 10^{-203} \lor \neg \left(ew \leq 1.4 \cdot 10^{-99}\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\\
\end{array}
\end{array}
if ew < -4.09999999999999981e-203 or 1.4e-99 < ew Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.2%
pow399.2%
Applied egg-rr98.7%
unpow398.7%
add-cube-cbrt99.3%
clear-num99.2%
Applied egg-rr99.2%
Taylor expanded in ew around inf 77.8%
if -4.09999999999999981e-203 < ew < 1.4e-99Initial program 99.8%
Applied egg-rr58.5%
Taylor expanded in eh around inf 46.9%
associate-*r*46.9%
*-commutative46.9%
associate-*r/46.9%
associate-*r/46.9%
*-commutative46.9%
associate-*r/46.9%
Simplified46.9%
Taylor expanded in t around 0 58.6%
Final simplification73.4%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos t))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(t)));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * cos(t)))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(t)));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(t)))
function code(eh, ew, t) return abs(Float64(ew * cos(t))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(t))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \cos t\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr98.6%
unpow398.6%
add-cube-cbrt99.1%
clear-num99.0%
Applied egg-rr99.0%
Taylor expanded in ew around inf 65.7%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -2e-14) (not (<= t 6.5e-7))) (* ew (cos t)) (fabs ew)))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2e-14) || !(t <= 6.5e-7)) {
tmp = ew * cos(t);
} else {
tmp = fabs(ew);
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2d-14)) .or. (.not. (t <= 6.5d-7))) then
tmp = ew * cos(t)
else
tmp = abs(ew)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2e-14) || !(t <= 6.5e-7)) {
tmp = ew * Math.cos(t);
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -2e-14) or not (t <= 6.5e-7): tmp = ew * math.cos(t) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -2e-14) || !(t <= 6.5e-7)) tmp = Float64(ew * cos(t)); else tmp = abs(ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -2e-14) || ~((t <= 6.5e-7))) tmp = ew * cos(t); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -2e-14], N[Not[LessEqual[t, 6.5e-7]], $MachinePrecision]], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-14} \lor \neg \left(t \leq 6.5 \cdot 10^{-7}\right):\\
\;\;\;\;ew \cdot \cos t\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if t < -2e-14 or 6.50000000000000024e-7 < t Initial program 99.6%
Applied egg-rr51.8%
Taylor expanded in eh around 0 30.7%
if -2e-14 < t < 6.50000000000000024e-7Initial program 100.0%
fabs-sub100.0%
sub-neg100.0%
+-commutative100.0%
associate-*l*100.0%
distribute-rgt-neg-in100.0%
fma-define100.0%
Simplified100.0%
add-cube-cbrt100.0%
pow3100.0%
Applied egg-rr98.9%
unpow398.9%
add-cube-cbrt98.9%
clear-num98.9%
Applied egg-rr98.9%
Taylor expanded in t around 0 78.8%
Final simplification53.6%
(FPCore (eh ew t) :precision binary64 (fabs ew))
double code(double eh, double ew, double t) {
return fabs(ew);
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs(ew)
end function
public static double code(double eh, double ew, double t) {
return Math.abs(ew);
}
def code(eh, ew, t): return math.fabs(ew)
function code(eh, ew, t) return abs(ew) end
function tmp = code(eh, ew, t) tmp = abs(ew); end
code[eh_, ew_, t_] := N[Abs[ew], $MachinePrecision]
\begin{array}{l}
\\
\left|ew\right|
\end{array}
Initial program 99.8%
fabs-sub99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Simplified99.8%
add-cube-cbrt99.3%
pow399.3%
Applied egg-rr98.6%
unpow398.6%
add-cube-cbrt99.1%
clear-num99.0%
Applied egg-rr99.0%
Taylor expanded in t around 0 45.1%
(FPCore (eh ew t) :precision binary64 ew)
double code(double eh, double ew, double t) {
return ew;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = ew
end function
public static double code(double eh, double ew, double t) {
return ew;
}
def code(eh, ew, t): return ew
function code(eh, ew, t) return ew end
function tmp = code(eh, ew, t) tmp = ew; end
code[eh_, ew_, t_] := ew
\begin{array}{l}
\\
ew
\end{array}
Initial program 99.8%
Applied egg-rr51.9%
Taylor expanded in t around 0 25.3%
herbie shell --seed 2024139
(FPCore (eh ew t)
:name "Example 2 from Robby"
:precision binary64
(fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))