
(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 12 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 (* eh (/ (tan t) ew))))
(fabs
(fma eh (* (sin t) (sin (atan t_1))) (/ (* ew (cos t)) (hypot 1.0 t_1))))))
double code(double eh, double ew, double t) {
double t_1 = eh * (tan(t) / ew);
return fabs(fma(eh, (sin(t) * sin(atan(t_1))), ((ew * cos(t)) / hypot(1.0, t_1))));
}
function code(eh, ew, t) t_1 = Float64(eh * Float64(tan(t) / ew)) return abs(fma(eh, Float64(sin(t) * sin(atan(t_1))), Float64(Float64(ew * cos(t)) / hypot(1.0, t_1)))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \frac{\tan t}{ew}\\
\left|\mathsf{fma}\left(eh, \sin t \cdot \sin \tan^{-1} t\_1, \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, t\_1\right)}\right)\right|
\end{array}
\end{array}
Initial program 99.8%
sub-neg99.8%
Applied egg-rr99.8%
+-commutative99.8%
fma-define99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (tan t) (/ eh ew))))
(fabs
(+
(/ (* ew (cos t)) (hypot 1.0 t_1))
(* eh (* (sin t) (sin (atan t_1))))))))
double code(double eh, double ew, double t) {
double t_1 = tan(t) * (eh / ew);
return fabs((((ew * cos(t)) / hypot(1.0, t_1)) + (eh * (sin(t) * sin(atan(t_1))))));
}
public static double code(double eh, double ew, double t) {
double t_1 = Math.tan(t) * (eh / ew);
return Math.abs((((ew * Math.cos(t)) / Math.hypot(1.0, t_1)) + (eh * (Math.sin(t) * Math.sin(Math.atan(t_1))))));
}
def code(eh, ew, t): t_1 = math.tan(t) * (eh / ew) return math.fabs((((ew * math.cos(t)) / math.hypot(1.0, t_1)) + (eh * (math.sin(t) * math.sin(math.atan(t_1))))))
function code(eh, ew, t) t_1 = Float64(tan(t) * Float64(eh / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, t_1)) + Float64(eh * Float64(sin(t) * sin(atan(t_1)))))) end
function tmp = code(eh, ew, t) t_1 = tan(t) * (eh / ew); tmp = abs((((ew * cos(t)) / hypot(1.0, t_1)) + (eh * (sin(t) * sin(atan(t_1)))))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan t \cdot \frac{eh}{ew}\\
\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, t\_1\right)} + eh \cdot \left(\sin t \cdot \sin \tan^{-1} t\_1\right)\right|
\end{array}
\end{array}
Initial program 99.8%
sub-neg99.8%
Applied egg-rr99.8%
(FPCore (eh ew t) :precision binary64 (fabs (fma eh (* (sin t) (sin (atan (/ (* eh t) ew)))) (/ (* ew (cos t)) (hypot 1.0 (* eh (/ (tan t) ew)))))))
double code(double eh, double ew, double t) {
return fabs(fma(eh, (sin(t) * sin(atan(((eh * t) / ew)))), ((ew * cos(t)) / hypot(1.0, (eh * (tan(t) / ew))))));
}
function code(eh, ew, t) return abs(fma(eh, Float64(sin(t) * sin(atan(Float64(Float64(eh * t) / ew)))), Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(eh * Float64(tan(t) / ew)))))) end
code[eh_, ew_, t_] := N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(eh, \sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right), \frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, eh \cdot \frac{\tan t}{ew}\right)}\right)\right|
\end{array}
Initial program 99.8%
sub-neg99.8%
Applied egg-rr99.8%
+-commutative99.8%
fma-define99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 99.3%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* eh (* (sin t) (sin (atan (* (tan t) (/ eh ew)))))) (/ -1.0 (/ -1.0 (* ew (cos t)))))))
double code(double eh, double ew, double t) {
return fabs(((eh * (sin(t) * sin(atan((tan(t) * (eh / ew)))))) + (-1.0 / (-1.0 / (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(((eh * (sin(t) * sin(atan((tan(t) * (eh / ew)))))) + ((-1.0d0) / ((-1.0d0) / (ew * cos(t))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((eh * (Math.sin(t) * Math.sin(Math.atan((Math.tan(t) * (eh / ew)))))) + (-1.0 / (-1.0 / (ew * Math.cos(t))))));
}
def code(eh, ew, t): return math.fabs(((eh * (math.sin(t) * math.sin(math.atan((math.tan(t) * (eh / ew)))))) + (-1.0 / (-1.0 / (ew * math.cos(t))))))
function code(eh, ew, t) return abs(Float64(Float64(eh * Float64(sin(t) * sin(atan(Float64(tan(t) * Float64(eh / ew)))))) + Float64(-1.0 / Float64(-1.0 / Float64(ew * cos(t)))))) end
function tmp = code(eh, ew, t) tmp = abs(((eh * (sin(t) * sin(atan((tan(t) * (eh / ew)))))) + (-1.0 / (-1.0 / (ew * cos(t)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(-1.0 / N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{ew}\right)\right) + \frac{-1}{\frac{-1}{ew \cdot \cos t}}\right|
\end{array}
Initial program 99.8%
sub-neg99.8%
Applied egg-rr99.8%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in eh around 0 98.8%
Final simplification98.8%
(FPCore (eh ew t)
:precision binary64
(if (<= t -7e+146)
(fabs (* ew (cos t)))
(if (<= t -8.8e-7)
(fabs (* eh (* (sin t) (sin (atan (/ (* eh (tan t)) ew))))))
(if (<= t 5.6e-22)
(fabs (+ ew (* (sin (atan (* eh (/ (tan t) ew)))) (* eh t))))
(fabs (* (* eh (sin t)) (sin (atan (* (tan t) (/ eh (- ew)))))))))))
double code(double eh, double ew, double t) {
double tmp;
if (t <= -7e+146) {
tmp = fabs((ew * cos(t)));
} else if (t <= -8.8e-7) {
tmp = fabs((eh * (sin(t) * sin(atan(((eh * tan(t)) / ew))))));
} else if (t <= 5.6e-22) {
tmp = fabs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t))));
} else {
tmp = fabs(((eh * sin(t)) * sin(atan((tan(t) * (eh / -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 <= (-7d+146)) then
tmp = abs((ew * cos(t)))
else if (t <= (-8.8d-7)) then
tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / ew))))))
else if (t <= 5.6d-22) then
tmp = abs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t))))
else
tmp = abs(((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (t <= -7e+146) {
tmp = Math.abs((ew * Math.cos(t)));
} else if (t <= -8.8e-7) {
tmp = Math.abs((eh * (Math.sin(t) * Math.sin(Math.atan(((eh * Math.tan(t)) / ew))))));
} else if (t <= 5.6e-22) {
tmp = Math.abs((ew + (Math.sin(Math.atan((eh * (Math.tan(t) / ew)))) * (eh * t))));
} else {
tmp = Math.abs(((eh * Math.sin(t)) * Math.sin(Math.atan((Math.tan(t) * (eh / -ew))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if t <= -7e+146: tmp = math.fabs((ew * math.cos(t))) elif t <= -8.8e-7: tmp = math.fabs((eh * (math.sin(t) * math.sin(math.atan(((eh * math.tan(t)) / ew)))))) elif t <= 5.6e-22: tmp = math.fabs((ew + (math.sin(math.atan((eh * (math.tan(t) / ew)))) * (eh * t)))) else: tmp = math.fabs(((eh * math.sin(t)) * math.sin(math.atan((math.tan(t) * (eh / -ew)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (t <= -7e+146) tmp = abs(Float64(ew * cos(t))); elseif (t <= -8.8e-7) tmp = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * tan(t)) / ew)))))); elseif (t <= 5.6e-22) tmp = abs(Float64(ew + Float64(sin(atan(Float64(eh * Float64(tan(t) / ew)))) * Float64(eh * t)))); else tmp = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (t <= -7e+146) tmp = abs((ew * cos(t))); elseif (t <= -8.8e-7) tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / ew)))))); elseif (t <= 5.6e-22) tmp = abs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t)))); else tmp = abs(((eh * sin(t)) * sin(atan((tan(t) * (eh / -ew)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[t, -7e+146], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, -8.8e-7], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 5.6e-22], N[Abs[N[(ew + N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[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]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+146}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{elif}\;t \leq -8.8 \cdot 10^{-7}:\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\right|\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-22}:\\
\;\;\;\;\left|ew + \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|\\
\end{array}
\end{array}
if t < -7.0000000000000002e146Initial program 99.6%
sub-neg99.6%
Applied egg-rr99.5%
+-commutative99.5%
fma-define99.5%
associate-*r/99.5%
associate-*l/99.5%
*-commutative99.5%
associate-*r/99.5%
associate-*l/99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in eh around 0 64.1%
if -7.0000000000000002e146 < t < -8.8000000000000004e-7Initial program 99.6%
sub-neg99.6%
Applied egg-rr99.6%
+-commutative99.6%
fma-define99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in eh around inf 68.2%
if -8.8000000000000004e-7 < t < 5.5999999999999999e-22Initial program 100.0%
sub-neg100.0%
Applied egg-rr100.0%
+-commutative100.0%
fma-define100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 99.7%
associate-*r*99.7%
associate-*r/99.7%
Simplified99.7%
if 5.5999999999999999e-22 < t Initial program 99.7%
Taylor expanded in ew around 0 59.9%
mul-1-neg59.9%
associate-*r*59.9%
distribute-rgt-neg-in59.9%
mul-1-neg59.9%
associate-*r/59.9%
*-commutative59.9%
associate-*l/59.9%
associate-*r/59.9%
distribute-rgt-neg-in59.9%
distribute-neg-frac259.9%
Simplified59.9%
Final simplification82.0%
(FPCore (eh ew t)
:precision binary64
(if (<= t -2.4e+147)
(fabs (* ew (cos t)))
(if (or (<= t -8.8e-7) (not (<= t 5.6e-22)))
(fabs (* eh (* (sin t) (sin (atan (/ (* eh (tan t)) ew))))))
(fabs (+ ew (* (sin (atan (* eh (/ (tan t) ew)))) (* eh t)))))))
double code(double eh, double ew, double t) {
double tmp;
if (t <= -2.4e+147) {
tmp = fabs((ew * cos(t)));
} else if ((t <= -8.8e-7) || !(t <= 5.6e-22)) {
tmp = fabs((eh * (sin(t) * sin(atan(((eh * tan(t)) / ew))))));
} else {
tmp = fabs((ew + (sin(atan((eh * (tan(t) / 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 <= (-2.4d+147)) then
tmp = abs((ew * cos(t)))
else if ((t <= (-8.8d-7)) .or. (.not. (t <= 5.6d-22))) then
tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / ew))))))
else
tmp = abs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (t <= -2.4e+147) {
tmp = Math.abs((ew * Math.cos(t)));
} else if ((t <= -8.8e-7) || !(t <= 5.6e-22)) {
tmp = Math.abs((eh * (Math.sin(t) * Math.sin(Math.atan(((eh * Math.tan(t)) / ew))))));
} else {
tmp = Math.abs((ew + (Math.sin(Math.atan((eh * (Math.tan(t) / ew)))) * (eh * t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if t <= -2.4e+147: tmp = math.fabs((ew * math.cos(t))) elif (t <= -8.8e-7) or not (t <= 5.6e-22): tmp = math.fabs((eh * (math.sin(t) * math.sin(math.atan(((eh * math.tan(t)) / ew)))))) else: tmp = math.fabs((ew + (math.sin(math.atan((eh * (math.tan(t) / ew)))) * (eh * t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if (t <= -2.4e+147) tmp = abs(Float64(ew * cos(t))); elseif ((t <= -8.8e-7) || !(t <= 5.6e-22)) tmp = abs(Float64(eh * Float64(sin(t) * sin(atan(Float64(Float64(eh * tan(t)) / ew)))))); else tmp = abs(Float64(ew + Float64(sin(atan(Float64(eh * Float64(tan(t) / ew)))) * Float64(eh * t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (t <= -2.4e+147) tmp = abs((ew * cos(t))); elseif ((t <= -8.8e-7) || ~((t <= 5.6e-22))) tmp = abs((eh * (sin(t) * sin(atan(((eh * tan(t)) / ew)))))); else tmp = abs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[t, -2.4e+147], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[t, -8.8e-7], N[Not[LessEqual[t, 5.6e-22]], $MachinePrecision]], N[Abs[N[(eh * N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew + N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+147}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{elif}\;t \leq -8.8 \cdot 10^{-7} \lor \neg \left(t \leq 5.6 \cdot 10^{-22}\right):\\
\;\;\;\;\left|eh \cdot \left(\sin t \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew + \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\end{array}
\end{array}
if t < -2.40000000000000002e147Initial program 99.6%
sub-neg99.6%
Applied egg-rr99.5%
+-commutative99.5%
fma-define99.5%
associate-*r/99.5%
associate-*l/99.5%
*-commutative99.5%
associate-*r/99.5%
associate-*l/99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in eh around 0 64.1%
if -2.40000000000000002e147 < t < -8.8000000000000004e-7 or 5.5999999999999999e-22 < t Initial program 99.7%
sub-neg99.7%
Applied egg-rr99.7%
+-commutative99.7%
fma-define99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in eh around inf 61.9%
if -8.8000000000000004e-7 < t < 5.5999999999999999e-22Initial program 100.0%
sub-neg100.0%
Applied egg-rr100.0%
+-commutative100.0%
fma-define100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 99.7%
associate-*r*99.7%
associate-*r/99.7%
Simplified99.7%
Final simplification82.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= t -2.1e+17)
t_1
(if (<= t 1.7)
(fabs (+ ew (* (sin (atan (* eh (/ (tan t) ew)))) (* eh t))))
(if (<= t 2.2e+75)
t_1
(fabs
(*
ew
(* eh (* (sin t) (/ (sin (atan (* eh (/ t (- ew))))) ew))))))))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (t <= -2.1e+17) {
tmp = t_1;
} else if (t <= 1.7) {
tmp = fabs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t))));
} else if (t <= 2.2e+75) {
tmp = t_1;
} else {
tmp = fabs((ew * (eh * (sin(t) * (sin(atan((eh * (t / -ew)))) / 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) :: t_1
real(8) :: tmp
t_1 = abs((ew * cos(t)))
if (t <= (-2.1d+17)) then
tmp = t_1
else if (t <= 1.7d0) then
tmp = abs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t))))
else if (t <= 2.2d+75) then
tmp = t_1
else
tmp = abs((ew * (eh * (sin(t) * (sin(atan((eh * (t / -ew)))) / ew)))))
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 tmp;
if (t <= -2.1e+17) {
tmp = t_1;
} else if (t <= 1.7) {
tmp = Math.abs((ew + (Math.sin(Math.atan((eh * (Math.tan(t) / ew)))) * (eh * t))));
} else if (t <= 2.2e+75) {
tmp = t_1;
} else {
tmp = Math.abs((ew * (eh * (Math.sin(t) * (Math.sin(Math.atan((eh * (t / -ew)))) / ew)))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if t <= -2.1e+17: tmp = t_1 elif t <= 1.7: tmp = math.fabs((ew + (math.sin(math.atan((eh * (math.tan(t) / ew)))) * (eh * t)))) elif t <= 2.2e+75: tmp = t_1 else: tmp = math.fabs((ew * (eh * (math.sin(t) * (math.sin(math.atan((eh * (t / -ew)))) / ew))))) return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (t <= -2.1e+17) tmp = t_1; elseif (t <= 1.7) tmp = abs(Float64(ew + Float64(sin(atan(Float64(eh * Float64(tan(t) / ew)))) * Float64(eh * t)))); elseif (t <= 2.2e+75) tmp = t_1; else tmp = abs(Float64(ew * Float64(eh * Float64(sin(t) * Float64(sin(atan(Float64(eh * Float64(t / Float64(-ew))))) / ew))))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * cos(t))); tmp = 0.0; if (t <= -2.1e+17) tmp = t_1; elseif (t <= 1.7) tmp = abs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t)))); elseif (t <= 2.2e+75) tmp = t_1; else tmp = abs((ew * (eh * (sin(t) * (sin(atan((eh * (t / -ew)))) / ew))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2.1e+17], t$95$1, If[LessEqual[t, 1.7], N[Abs[N[(ew + N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 2.2e+75], t$95$1, N[Abs[N[(ew * N[(eh * N[(N[Sin[t], $MachinePrecision] * N[(N[Sin[N[ArcTan[N[(eh * N[(t / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.7:\\
\;\;\;\;\left|ew + \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(eh \cdot \left(\sin t \cdot \frac{\sin \tan^{-1} \left(eh \cdot \frac{t}{-ew}\right)}{ew}\right)\right)\right|\\
\end{array}
\end{array}
if t < -2.1e17 or 1.69999999999999996 < t < 2.20000000000000012e75Initial program 99.7%
sub-neg99.7%
Applied egg-rr99.6%
+-commutative99.6%
fma-define99.6%
associate-*r/99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*r/99.6%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in eh around 0 58.7%
if -2.1e17 < t < 1.69999999999999996Initial program 100.0%
sub-neg100.0%
Applied egg-rr100.0%
+-commutative100.0%
fma-define100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 96.5%
associate-*r*96.5%
associate-*r/96.5%
Simplified96.5%
if 2.20000000000000012e75 < t Initial program 99.7%
Taylor expanded in ew around inf 97.7%
Taylor expanded in eh around inf 62.4%
mul-1-neg62.4%
associate-/l*62.0%
distribute-rgt-neg-in62.0%
associate-/l*62.1%
distribute-lft-neg-in62.1%
mul-1-neg62.1%
associate-*r/62.1%
distribute-rgt-neg-in62.1%
Simplified62.1%
Taylor expanded in t around 0 62.6%
mul-1-neg62.6%
associate-/l*62.6%
distribute-lft-neg-in62.6%
Simplified62.6%
Final simplification80.5%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -2.1e+17) (not (<= t 1.7))) (fabs (* ew (cos t))) (fabs (+ ew (* (sin (atan (* eh (/ (tan t) ew)))) (* eh t))))))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2.1e+17) || !(t <= 1.7)) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs((ew + (sin(atan((eh * (tan(t) / 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 <= (-2.1d+17)) .or. (.not. (t <= 1.7d0))) then
tmp = abs((ew * cos(t)))
else
tmp = abs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((t <= -2.1e+17) || !(t <= 1.7)) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = Math.abs((ew + (Math.sin(Math.atan((eh * (Math.tan(t) / ew)))) * (eh * t))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -2.1e+17) or not (t <= 1.7): tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs((ew + (math.sin(math.atan((eh * (math.tan(t) / ew)))) * (eh * t)))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -2.1e+17) || !(t <= 1.7)) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(ew + Float64(sin(atan(Float64(eh * Float64(tan(t) / ew)))) * Float64(eh * t)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((t <= -2.1e+17) || ~((t <= 1.7))) tmp = abs((ew * cos(t))); else tmp = abs((ew + (sin(atan((eh * (tan(t) / ew)))) * (eh * t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -2.1e+17], N[Not[LessEqual[t, 1.7]], $MachinePrecision]], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew + N[(N[Sin[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+17} \lor \neg \left(t \leq 1.7\right):\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew + \sin \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot \left(eh \cdot t\right)\right|\\
\end{array}
\end{array}
if t < -2.1e17 or 1.69999999999999996 < t Initial program 99.7%
sub-neg99.7%
Applied egg-rr99.7%
+-commutative99.7%
fma-define99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in eh around 0 50.2%
if -2.1e17 < t < 1.69999999999999996Initial program 100.0%
sub-neg100.0%
Applied egg-rr100.0%
+-commutative100.0%
fma-define100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 96.5%
associate-*r*96.5%
associate-*r/96.5%
Simplified96.5%
Final simplification76.1%
(FPCore (eh ew t) :precision binary64 (if (or (<= eh -9.8e+127) (not (<= eh 2e+116))) (fabs (* eh (* t (sin (atan (* (tan t) (/ eh (- ew)))))))) (fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -9.8e+127) || !(eh <= 2e+116)) {
tmp = fabs((eh * (t * sin(atan((tan(t) * (eh / -ew)))))));
} else {
tmp = fabs((ew * cos(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 ((eh <= (-9.8d+127)) .or. (.not. (eh <= 2d+116))) then
tmp = abs((eh * (t * sin(atan((tan(t) * (eh / -ew)))))))
else
tmp = abs((ew * cos(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if ((eh <= -9.8e+127) || !(eh <= 2e+116)) {
tmp = Math.abs((eh * (t * Math.sin(Math.atan((Math.tan(t) * (eh / -ew)))))));
} else {
tmp = Math.abs((ew * Math.cos(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (eh <= -9.8e+127) or not (eh <= 2e+116): tmp = math.fabs((eh * (t * math.sin(math.atan((math.tan(t) * (eh / -ew))))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if ((eh <= -9.8e+127) || !(eh <= 2e+116)) tmp = abs(Float64(eh * Float64(t * sin(atan(Float64(tan(t) * Float64(eh / Float64(-ew)))))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if ((eh <= -9.8e+127) || ~((eh <= 2e+116))) tmp = abs((eh * (t * sin(atan((tan(t) * (eh / -ew))))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[eh, -9.8e+127], N[Not[LessEqual[eh, 2e+116]], $MachinePrecision]], N[Abs[N[(eh * N[(t * N[Sin[N[ArcTan[N[(N[Tan[t], $MachinePrecision] * N[(eh / (-ew)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -9.8 \cdot 10^{+127} \lor \neg \left(eh \leq 2 \cdot 10^{+116}\right):\\
\;\;\;\;\left|eh \cdot \left(t \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if eh < -9.80000000000000074e127 or 2.00000000000000003e116 < eh Initial program 99.8%
Taylor expanded in ew around inf 80.5%
Taylor expanded in eh around inf 63.9%
mul-1-neg63.9%
associate-/l*63.4%
distribute-rgt-neg-in63.4%
associate-/l*63.5%
distribute-lft-neg-in63.5%
mul-1-neg63.5%
associate-*r/63.5%
distribute-rgt-neg-in63.5%
Simplified63.5%
Taylor expanded in t around 0 43.7%
mul-1-neg43.7%
*-commutative43.7%
distribute-rgt-neg-in43.7%
mul-1-neg43.7%
*-commutative43.7%
associate-*r/43.7%
distribute-rgt-neg-in43.7%
distribute-neg-frac243.7%
Simplified43.7%
if -9.80000000000000074e127 < eh < 2.00000000000000003e116Initial program 99.8%
sub-neg99.8%
Applied egg-rr99.8%
+-commutative99.8%
fma-define99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in eh around 0 76.2%
Final simplification65.8%
(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%
sub-neg99.8%
Applied egg-rr99.8%
+-commutative99.8%
fma-define99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in eh around 0 58.5%
(FPCore (eh ew t) :precision binary64 (if (or (<= t -1.8e+20) (not (<= t 2600000000000.0))) (* ew (cos t)) (fabs ew)))
double code(double eh, double ew, double t) {
double tmp;
if ((t <= -1.8e+20) || !(t <= 2600000000000.0)) {
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 <= (-1.8d+20)) .or. (.not. (t <= 2600000000000.0d0))) 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 <= -1.8e+20) || !(t <= 2600000000000.0)) {
tmp = ew * Math.cos(t);
} else {
tmp = Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if (t <= -1.8e+20) or not (t <= 2600000000000.0): tmp = ew * math.cos(t) else: tmp = math.fabs(ew) return tmp
function code(eh, ew, t) tmp = 0.0 if ((t <= -1.8e+20) || !(t <= 2600000000000.0)) 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 <= -1.8e+20) || ~((t <= 2600000000000.0))) tmp = ew * cos(t); else tmp = abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -1.8e+20], N[Not[LessEqual[t, 2600000000000.0]], $MachinePrecision]], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision], N[Abs[ew], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+20} \lor \neg \left(t \leq 2600000000000\right):\\
\;\;\;\;ew \cdot \cos t\\
\mathbf{else}:\\
\;\;\;\;\left|ew\right|\\
\end{array}
\end{array}
if t < -1.8e20 or 2.6e12 < t Initial program 99.7%
sub-neg99.7%
Applied egg-rr99.7%
+-commutative99.7%
fma-define99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in eh around 0 50.2%
add-sqr-sqrt23.8%
fabs-sqr23.8%
add-sqr-sqrt24.9%
*-commutative24.9%
Applied egg-rr24.9%
if -1.8e20 < t < 2.6e12Initial program 100.0%
sub-neg100.0%
Applied egg-rr100.0%
+-commutative100.0%
fma-define100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
associate-*r/100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 64.2%
Final simplification47.2%
(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%
sub-neg99.8%
Applied egg-rr99.8%
+-commutative99.8%
fma-define99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*r/99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 42.3%
herbie shell --seed 2024170
(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)))))))