
(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 18 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
(* (sin t) (sin (atan t_1)))
(- eh)
(/ (* ew (cos t)) (sqrt (+ (pow t_1 2.0) 1.0)))))))
double code(double eh, double ew, double t) {
double t_1 = eh * (tan(t) / -ew);
return fabs(fma((sin(t) * sin(atan(t_1))), -eh, ((ew * cos(t)) / sqrt((pow(t_1, 2.0) + 1.0)))));
}
function code(eh, ew, t) t_1 = Float64(eh * Float64(tan(t) / Float64(-ew))) return abs(fma(Float64(sin(t) * sin(atan(t_1))), Float64(-eh), Float64(Float64(ew * cos(t)) / sqrt(Float64((t_1 ^ 2.0) + 1.0))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-eh) + N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[t$95$1, 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \frac{\tan t}{-ew}\\
\left|\mathsf{fma}\left(\sin t \cdot \sin \tan^{-1} t\_1, -eh, \frac{ew \cdot \cos t}{\sqrt{{t\_1}^{2} + 1}}\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh))
(t_2 (* ew (cos t)))
(t_3 (atan (/ (* (- eh) (tan t)) ew)))
(t_4 (sin t_3)))
(if (<= (- (* t_2 (cos t_3)) (* t_1 t_4)) -5e-269)
(fabs
(/
(+ t_2 (* eh (* (sin t) (* eh (/ (tan t) ew)))))
(sqrt (+ (pow (* eh (/ (tan t) (- ew))) 2.0) 1.0))))
(fma
(/ (cos t) (sqrt (+ (pow (/ (* eh (tan t)) ew) 2.0) 1.0)))
ew
(* t_4 (- t_1))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double t_2 = ew * cos(t);
double t_3 = atan(((-eh * tan(t)) / ew));
double t_4 = sin(t_3);
double tmp;
if (((t_2 * cos(t_3)) - (t_1 * t_4)) <= -5e-269) {
tmp = fabs(((t_2 + (eh * (sin(t) * (eh * (tan(t) / ew))))) / sqrt((pow((eh * (tan(t) / -ew)), 2.0) + 1.0))));
} else {
tmp = fma((cos(t) / sqrt((pow(((eh * tan(t)) / ew), 2.0) + 1.0))), ew, (t_4 * -t_1));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) t_2 = Float64(ew * cos(t)) t_3 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) t_4 = sin(t_3) tmp = 0.0 if (Float64(Float64(t_2 * cos(t_3)) - Float64(t_1 * t_4)) <= -5e-269) tmp = abs(Float64(Float64(t_2 + Float64(eh * Float64(sin(t) * Float64(eh * Float64(tan(t) / ew))))) / sqrt(Float64((Float64(eh * Float64(tan(t) / Float64(-ew))) ^ 2.0) + 1.0)))); else tmp = fma(Float64(cos(t) / sqrt(Float64((Float64(Float64(eh * tan(t)) / ew) ^ 2.0) + 1.0))), ew, Float64(t_4 * Float64(-t_1))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$2 * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision], -5e-269], N[Abs[N[(N[(t$95$2 + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(t$95$4 * (-t$95$1)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := ew \cdot \cos t\\
t_3 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
t_4 := \sin t\_3\\
\mathbf{if}\;t\_2 \cdot \cos t\_3 - t\_1 \cdot t\_4 \leq -5 \cdot 10^{-269}:\\
\;\;\;\;\left|\frac{t\_2 + eh \cdot \left(\sin t \cdot \left(eh \cdot \frac{\tan t}{ew}\right)\right)}{\sqrt{{\left(eh \cdot \frac{\tan t}{-ew}\right)}^{2} + 1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\cos t}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}, ew, t\_4 \cdot \left(-t\_1\right)\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -4.99999999999999979e-269Initial program 99.8%
Applied rewrites79.7%
if -4.99999999999999979e-269 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.7%
Applied rewrites99.7%
Applied rewrites99.7%
Final simplification89.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))) (t_2 (atan (/ (* (- eh) (tan t)) ew))))
(if (<= (- (* t_1 (cos t_2)) (* (* (sin t) eh) (sin t_2))) 1e-106)
(fabs ew)
t_1)))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double t_2 = atan(((-eh * tan(t)) / ew));
double tmp;
if (((t_1 * cos(t_2)) - ((sin(t) * eh) * sin(t_2))) <= 1e-106) {
tmp = fabs(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 = ew * cos(t)
t_2 = atan(((-eh * tan(t)) / ew))
if (((t_1 * cos(t_2)) - ((sin(t) * eh) * sin(t_2))) <= 1d-106) then
tmp = abs(ew)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = ew * Math.cos(t);
double t_2 = Math.atan(((-eh * Math.tan(t)) / ew));
double tmp;
if (((t_1 * Math.cos(t_2)) - ((Math.sin(t) * eh) * Math.sin(t_2))) <= 1e-106) {
tmp = Math.abs(ew);
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) t_2 = math.atan(((-eh * math.tan(t)) / ew)) tmp = 0 if ((t_1 * math.cos(t_2)) - ((math.sin(t) * eh) * math.sin(t_2))) <= 1e-106: tmp = math.fabs(ew) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) tmp = 0.0 if (Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(sin(t) * eh) * sin(t_2))) <= 1e-106) tmp = abs(ew); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); t_2 = atan(((-eh * tan(t)) / ew)); tmp = 0.0; if (((t_1 * cos(t_2)) - ((sin(t) * eh) * sin(t_2))) <= 1e-106) tmp = abs(ew); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-106], N[Abs[ew], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(\sin t \cdot eh\right) \cdot \sin t\_2 \leq 10^{-106}:\\
\;\;\;\;\left|ew\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < 9.99999999999999941e-107Initial program 99.8%
Applied rewrites78.9%
Taylor expanded in t around 0
lower-/.f6443.5
Applied rewrites43.5%
fabs-divN/A
metadata-evalN/A
remove-double-divN/A
lower-fabs.f6443.6
Applied rewrites43.6%
if 9.99999999999999941e-107 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.7%
Applied rewrites99.7%
Applied rewrites62.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6464.9
Applied rewrites64.9%
Final simplification53.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(fma (cos t) ew (* eh (* (* eh 0.5) (* (tan t) (/ (sin t) ew))))))))
(if (<= ew -6.7e-32)
t_1
(if (<= ew 1e-111)
(fabs (* (sin t) eh))
(if (<= ew 5.1e+75)
(/
(fabs (fma ew (* ew (cos t)) (* (* eh eh) (* (sin t) (tan t)))))
(* ew (sqrt (+ (pow (* eh (/ (tan t) ew)) 2.0) 1.0))))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = fabs(fma(cos(t), ew, (eh * ((eh * 0.5) * (tan(t) * (sin(t) / ew))))));
double tmp;
if (ew <= -6.7e-32) {
tmp = t_1;
} else if (ew <= 1e-111) {
tmp = fabs((sin(t) * eh));
} else if (ew <= 5.1e+75) {
tmp = fabs(fma(ew, (ew * cos(t)), ((eh * eh) * (sin(t) * tan(t))))) / (ew * sqrt((pow((eh * (tan(t) / ew)), 2.0) + 1.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(fma(cos(t), ew, Float64(eh * Float64(Float64(eh * 0.5) * Float64(tan(t) * Float64(sin(t) / ew)))))) tmp = 0.0 if (ew <= -6.7e-32) tmp = t_1; elseif (ew <= 1e-111) tmp = abs(Float64(sin(t) * eh)); elseif (ew <= 5.1e+75) tmp = Float64(abs(fma(ew, Float64(ew * cos(t)), Float64(Float64(eh * eh) * Float64(sin(t) * tan(t))))) / Float64(ew * sqrt(Float64((Float64(eh * Float64(tan(t) / ew)) ^ 2.0) + 1.0)))); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Cos[t], $MachinePrecision] * ew + N[(eh * N[(N[(eh * 0.5), $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -6.7e-32], t$95$1, If[LessEqual[ew, 1e-111], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 5.1e+75], N[(N[Abs[N[(ew * N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * eh), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(ew * N[Sqrt[N[(N[Power[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\mathsf{fma}\left(\cos t, ew, eh \cdot \left(\left(eh \cdot 0.5\right) \cdot \left(\tan t \cdot \frac{\sin t}{ew}\right)\right)\right)\right|\\
\mathbf{if}\;ew \leq -6.7 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 10^{-111}:\\
\;\;\;\;\left|\sin t \cdot eh\right|\\
\mathbf{elif}\;ew \leq 5.1 \cdot 10^{+75}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(ew, ew \cdot \cos t, \left(eh \cdot eh\right) \cdot \left(\sin t \cdot \tan t\right)\right)\right|}{ew \cdot \sqrt{{\left(eh \cdot \frac{\tan t}{ew}\right)}^{2} + 1}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -6.7e-32 or 5.10000000000000037e75 < ew Initial program 99.8%
Applied rewrites84.8%
Taylor expanded in eh around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-cos.f6470.3
Applied rewrites70.3%
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-*l*N/A
Applied rewrites85.1%
if -6.7e-32 < ew < 1.00000000000000009e-111Initial program 99.8%
Applied rewrites50.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6472.7
Applied rewrites72.7%
if 1.00000000000000009e-111 < ew < 5.10000000000000037e75Initial program 99.6%
Applied rewrites85.7%
Taylor expanded in ew around 0
lower-/.f64N/A
Applied rewrites76.0%
Applied rewrites76.1%
Final simplification79.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -1.45e+149)
(fabs t_1)
(if (<= eh 6.2e+112)
(fabs
(/
(+ (* ew (cos t)) (* eh (* (sin t) (* eh (/ (tan t) ew)))))
(sqrt (+ (pow (* eh (/ (tan t) (- ew))) 2.0) 1.0))))
(/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -1.45e+149) {
tmp = fabs(t_1);
} else if (eh <= 6.2e+112) {
tmp = fabs((((ew * cos(t)) + (eh * (sin(t) * (eh * (tan(t) / ew))))) / sqrt((pow((eh * (tan(t) / -ew)), 2.0) + 1.0))));
} else {
tmp = 1.0 / fabs((1.0 / 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) :: tmp
t_1 = sin(t) * eh
if (eh <= (-1.45d+149)) then
tmp = abs(t_1)
else if (eh <= 6.2d+112) then
tmp = abs((((ew * cos(t)) + (eh * (sin(t) * (eh * (tan(t) / ew))))) / sqrt((((eh * (tan(t) / -ew)) ** 2.0d0) + 1.0d0))))
else
tmp = 1.0d0 / abs((1.0d0 / t_1))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * eh;
double tmp;
if (eh <= -1.45e+149) {
tmp = Math.abs(t_1);
} else if (eh <= 6.2e+112) {
tmp = Math.abs((((ew * Math.cos(t)) + (eh * (Math.sin(t) * (eh * (Math.tan(t) / ew))))) / Math.sqrt((Math.pow((eh * (Math.tan(t) / -ew)), 2.0) + 1.0))));
} else {
tmp = 1.0 / Math.abs((1.0 / t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * eh tmp = 0 if eh <= -1.45e+149: tmp = math.fabs(t_1) elif eh <= 6.2e+112: tmp = math.fabs((((ew * math.cos(t)) + (eh * (math.sin(t) * (eh * (math.tan(t) / ew))))) / math.sqrt((math.pow((eh * (math.tan(t) / -ew)), 2.0) + 1.0)))) else: tmp = 1.0 / math.fabs((1.0 / t_1)) return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -1.45e+149) tmp = abs(t_1); elseif (eh <= 6.2e+112) tmp = abs(Float64(Float64(Float64(ew * cos(t)) + Float64(eh * Float64(sin(t) * Float64(eh * Float64(tan(t) / ew))))) / sqrt(Float64((Float64(eh * Float64(tan(t) / Float64(-ew))) ^ 2.0) + 1.0)))); else tmp = Float64(1.0 / abs(Float64(1.0 / t_1))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * eh; tmp = 0.0; if (eh <= -1.45e+149) tmp = abs(t_1); elseif (eh <= 6.2e+112) tmp = abs((((ew * cos(t)) + (eh * (sin(t) * (eh * (tan(t) / ew))))) / sqrt((((eh * (tan(t) / -ew)) ^ 2.0) + 1.0)))); else tmp = 1.0 / abs((1.0 / t_1)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -1.45e+149], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 6.2e+112], N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(eh * N[(N[Sin[t], $MachinePrecision] * N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(eh * N[(N[Tan[t], $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -1.45 \cdot 10^{+149}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;eh \leq 6.2 \cdot 10^{+112}:\\
\;\;\;\;\left|\frac{ew \cdot \cos t + eh \cdot \left(\sin t \cdot \left(eh \cdot \frac{\tan t}{ew}\right)\right)}{\sqrt{{\left(eh \cdot \frac{\tan t}{-ew}\right)}^{2} + 1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\
\end{array}
\end{array}
if eh < -1.4500000000000001e149Initial program 99.9%
Applied rewrites33.7%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6467.1
Applied rewrites67.1%
if -1.4500000000000001e149 < eh < 6.19999999999999965e112Initial program 99.7%
Applied rewrites93.4%
if 6.19999999999999965e112 < eh Initial program 99.7%
Applied rewrites45.6%
Taylor expanded in ew around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6481.1
Applied rewrites81.1%
Final simplification87.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -1.45e+149)
(fabs t_1)
(if (<= eh 5.8e+112)
(fabs
(/
(+ (* ew (cos t)) (/ (* (sin t) (* (tan t) (* eh eh))) ew))
(sqrt (+ (pow (/ (* eh (tan t)) ew) 2.0) 1.0))))
(/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -1.45e+149) {
tmp = fabs(t_1);
} else if (eh <= 5.8e+112) {
tmp = fabs((((ew * cos(t)) + ((sin(t) * (tan(t) * (eh * eh))) / ew)) / sqrt((pow(((eh * tan(t)) / ew), 2.0) + 1.0))));
} else {
tmp = 1.0 / fabs((1.0 / 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) :: tmp
t_1 = sin(t) * eh
if (eh <= (-1.45d+149)) then
tmp = abs(t_1)
else if (eh <= 5.8d+112) then
tmp = abs((((ew * cos(t)) + ((sin(t) * (tan(t) * (eh * eh))) / ew)) / sqrt(((((eh * tan(t)) / ew) ** 2.0d0) + 1.0d0))))
else
tmp = 1.0d0 / abs((1.0d0 / t_1))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * eh;
double tmp;
if (eh <= -1.45e+149) {
tmp = Math.abs(t_1);
} else if (eh <= 5.8e+112) {
tmp = Math.abs((((ew * Math.cos(t)) + ((Math.sin(t) * (Math.tan(t) * (eh * eh))) / ew)) / Math.sqrt((Math.pow(((eh * Math.tan(t)) / ew), 2.0) + 1.0))));
} else {
tmp = 1.0 / Math.abs((1.0 / t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * eh tmp = 0 if eh <= -1.45e+149: tmp = math.fabs(t_1) elif eh <= 5.8e+112: tmp = math.fabs((((ew * math.cos(t)) + ((math.sin(t) * (math.tan(t) * (eh * eh))) / ew)) / math.sqrt((math.pow(((eh * math.tan(t)) / ew), 2.0) + 1.0)))) else: tmp = 1.0 / math.fabs((1.0 / t_1)) return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -1.45e+149) tmp = abs(t_1); elseif (eh <= 5.8e+112) tmp = abs(Float64(Float64(Float64(ew * cos(t)) + Float64(Float64(sin(t) * Float64(tan(t) * Float64(eh * eh))) / ew)) / sqrt(Float64((Float64(Float64(eh * tan(t)) / ew) ^ 2.0) + 1.0)))); else tmp = Float64(1.0 / abs(Float64(1.0 / t_1))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * eh; tmp = 0.0; if (eh <= -1.45e+149) tmp = abs(t_1); elseif (eh <= 5.8e+112) tmp = abs((((ew * cos(t)) + ((sin(t) * (tan(t) * (eh * eh))) / ew)) / sqrt(((((eh * tan(t)) / ew) ^ 2.0) + 1.0)))); else tmp = 1.0 / abs((1.0 / t_1)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -1.45e+149], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 5.8e+112], N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[t], $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] * N[(eh * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -1.45 \cdot 10^{+149}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;eh \leq 5.8 \cdot 10^{+112}:\\
\;\;\;\;\left|\frac{ew \cdot \cos t + \frac{\sin t \cdot \left(\tan t \cdot \left(eh \cdot eh\right)\right)}{ew}}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\
\end{array}
\end{array}
if eh < -1.4500000000000001e149Initial program 99.9%
Applied rewrites33.7%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6467.1
Applied rewrites67.1%
if -1.4500000000000001e149 < eh < 5.8000000000000004e112Initial program 99.7%
Applied rewrites99.8%
Applied rewrites92.9%
if 5.8000000000000004e112 < eh Initial program 99.7%
Applied rewrites45.6%
Taylor expanded in ew around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6481.1
Applied rewrites81.1%
Final simplification86.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -6.2e+111)
(fabs t_1)
(if (<= eh 5.5e+112)
(/
(fabs (fma (sin t) (* (tan t) (/ (* eh eh) ew)) (* ew (cos t))))
(sqrt (+ (pow (/ (* eh (tan t)) ew) 2.0) 1.0)))
(/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -6.2e+111) {
tmp = fabs(t_1);
} else if (eh <= 5.5e+112) {
tmp = fabs(fma(sin(t), (tan(t) * ((eh * eh) / ew)), (ew * cos(t)))) / sqrt((pow(((eh * tan(t)) / ew), 2.0) + 1.0));
} else {
tmp = 1.0 / fabs((1.0 / t_1));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -6.2e+111) tmp = abs(t_1); elseif (eh <= 5.5e+112) tmp = Float64(abs(fma(sin(t), Float64(tan(t) * Float64(Float64(eh * eh) / ew)), Float64(ew * cos(t)))) / sqrt(Float64((Float64(Float64(eh * tan(t)) / ew) ^ 2.0) + 1.0))); else tmp = Float64(1.0 / abs(Float64(1.0 / t_1))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -6.2e+111], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 5.5e+112], N[(N[Abs[N[(N[Sin[t], $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] * N[(N[(eh * eh), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] + N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -6.2 \cdot 10^{+111}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;eh \leq 5.5 \cdot 10^{+112}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(\sin t, \tan t \cdot \frac{eh \cdot eh}{ew}, ew \cdot \cos t\right)\right|}{\sqrt{{\left(\frac{eh \cdot \tan t}{ew}\right)}^{2} + 1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\
\end{array}
\end{array}
if eh < -6.2000000000000001e111Initial program 99.9%
Applied rewrites40.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6466.0
Applied rewrites66.0%
if -6.2000000000000001e111 < eh < 5.50000000000000026e112Initial program 99.7%
Applied rewrites99.8%
Applied rewrites92.0%
if 5.50000000000000026e112 < eh Initial program 99.7%
Applied rewrites45.6%
Taylor expanded in ew around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6481.1
Applied rewrites81.1%
Final simplification85.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -9e+93)
(fabs t_1)
(if (<= eh 2.35e+112)
(fabs (fma (cos t) ew (* eh (* (* eh 0.5) (* (tan t) (/ (sin t) ew))))))
(/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -9e+93) {
tmp = fabs(t_1);
} else if (eh <= 2.35e+112) {
tmp = fabs(fma(cos(t), ew, (eh * ((eh * 0.5) * (tan(t) * (sin(t) / ew))))));
} else {
tmp = 1.0 / fabs((1.0 / t_1));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -9e+93) tmp = abs(t_1); elseif (eh <= 2.35e+112) tmp = abs(fma(cos(t), ew, Float64(eh * Float64(Float64(eh * 0.5) * Float64(tan(t) * Float64(sin(t) / ew)))))); else tmp = Float64(1.0 / abs(Float64(1.0 / t_1))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -9e+93], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 2.35e+112], N[Abs[N[(N[Cos[t], $MachinePrecision] * ew + N[(eh * N[(N[(eh * 0.5), $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;eh \leq 2.35 \cdot 10^{+112}:\\
\;\;\;\;\left|\mathsf{fma}\left(\cos t, ew, eh \cdot \left(\left(eh \cdot 0.5\right) \cdot \left(\tan t \cdot \frac{\sin t}{ew}\right)\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\
\end{array}
\end{array}
if eh < -8.99999999999999981e93Initial program 99.8%
Applied rewrites46.0%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6465.5
Applied rewrites65.5%
if -8.99999999999999981e93 < eh < 2.34999999999999999e112Initial program 99.8%
Applied rewrites93.1%
Taylor expanded in eh around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-cos.f6479.9
Applied rewrites79.9%
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
associate-*l*N/A
Applied rewrites79.9%
if 2.34999999999999999e112 < eh Initial program 99.7%
Applied rewrites45.6%
Taylor expanded in ew around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6481.1
Applied rewrites81.1%
Final simplification77.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -9e+93)
(fabs t_1)
(if (<= eh 2.35e+112) (fabs (* ew (cos t))) (/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -9e+93) {
tmp = fabs(t_1);
} else if (eh <= 2.35e+112) {
tmp = fabs((ew * cos(t)));
} else {
tmp = 1.0 / fabs((1.0 / 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) :: tmp
t_1 = sin(t) * eh
if (eh <= (-9d+93)) then
tmp = abs(t_1)
else if (eh <= 2.35d+112) then
tmp = abs((ew * cos(t)))
else
tmp = 1.0d0 / abs((1.0d0 / t_1))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * eh;
double tmp;
if (eh <= -9e+93) {
tmp = Math.abs(t_1);
} else if (eh <= 2.35e+112) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = 1.0 / Math.abs((1.0 / t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * eh tmp = 0 if eh <= -9e+93: tmp = math.fabs(t_1) elif eh <= 2.35e+112: tmp = math.fabs((ew * math.cos(t))) else: tmp = 1.0 / math.fabs((1.0 / t_1)) return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -9e+93) tmp = abs(t_1); elseif (eh <= 2.35e+112) tmp = abs(Float64(ew * cos(t))); else tmp = Float64(1.0 / abs(Float64(1.0 / t_1))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * eh; tmp = 0.0; if (eh <= -9e+93) tmp = abs(t_1); elseif (eh <= 2.35e+112) tmp = abs((ew * cos(t))); else tmp = 1.0 / abs((1.0 / t_1)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -9e+93], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[eh, 2.35e+112], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;eh \leq 2.35 \cdot 10^{+112}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\
\end{array}
\end{array}
if eh < -8.99999999999999981e93Initial program 99.8%
Applied rewrites46.0%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6465.5
Applied rewrites65.5%
if -8.99999999999999981e93 < eh < 2.34999999999999999e112Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6479.7
Applied rewrites79.7%
if 2.34999999999999999e112 < eh Initial program 99.7%
Applied rewrites45.6%
Taylor expanded in ew around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6481.1
Applied rewrites81.1%
Final simplification76.9%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* (sin t) eh)))) (if (<= eh -9e+93) t_1 (if (<= eh 2.1e+112) (fabs (* ew (cos t))) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * eh));
double tmp;
if (eh <= -9e+93) {
tmp = t_1;
} else if (eh <= 2.1e+112) {
tmp = fabs((ew * cos(t)));
} 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) :: tmp
t_1 = abs((sin(t) * eh))
if (eh <= (-9d+93)) then
tmp = t_1
else if (eh <= 2.1d+112) then
tmp = abs((ew * cos(t)))
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((Math.sin(t) * eh));
double tmp;
if (eh <= -9e+93) {
tmp = t_1;
} else if (eh <= 2.1e+112) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(t) * eh)) tmp = 0 if eh <= -9e+93: tmp = t_1 elif eh <= 2.1e+112: tmp = math.fabs((ew * math.cos(t))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(t) * eh)) tmp = 0.0 if (eh <= -9e+93) tmp = t_1; elseif (eh <= 2.1e+112) tmp = abs(Float64(ew * cos(t))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(t) * eh)); tmp = 0.0; if (eh <= -9e+93) tmp = t_1; elseif (eh <= 2.1e+112) tmp = abs((ew * cos(t))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -9e+93], t$95$1, If[LessEqual[eh, 2.1e+112], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin t \cdot eh\right|\\
\mathbf{if}\;eh \leq -9 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 2.1 \cdot 10^{+112}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -8.99999999999999981e93 or 2.0999999999999999e112 < eh Initial program 99.8%
Applied rewrites39.2%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6472.0
Applied rewrites72.0%
if -8.99999999999999981e93 < eh < 2.0999999999999999e112Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6479.7
Applied rewrites79.7%
Final simplification76.8%
(FPCore (eh ew t) :precision binary64 (if (<= ew -6.7e-32) (fabs ew) (if (<= ew 8000000.0) (fabs (* (sin t) eh)) (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -6.7e-32) {
tmp = fabs(ew);
} else if (ew <= 8000000.0) {
tmp = fabs((sin(t) * eh));
} else {
tmp = 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 (ew <= (-6.7d-32)) then
tmp = abs(ew)
else if (ew <= 8000000.0d0) then
tmp = abs((sin(t) * eh))
else
tmp = ew * cos(t)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -6.7e-32) {
tmp = Math.abs(ew);
} else if (ew <= 8000000.0) {
tmp = Math.abs((Math.sin(t) * eh));
} else {
tmp = ew * Math.cos(t);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -6.7e-32: tmp = math.fabs(ew) elif ew <= 8000000.0: tmp = math.fabs((math.sin(t) * eh)) else: tmp = ew * math.cos(t) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -6.7e-32) tmp = abs(ew); elseif (ew <= 8000000.0) tmp = abs(Float64(sin(t) * eh)); else tmp = Float64(ew * cos(t)); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -6.7e-32) tmp = abs(ew); elseif (ew <= 8000000.0) tmp = abs((sin(t) * eh)); else tmp = ew * cos(t); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -6.7e-32], N[Abs[ew], $MachinePrecision], If[LessEqual[ew, 8000000.0], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -6.7 \cdot 10^{-32}:\\
\;\;\;\;\left|ew\right|\\
\mathbf{elif}\;ew \leq 8000000:\\
\;\;\;\;\left|\sin t \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;ew \cdot \cos t\\
\end{array}
\end{array}
if ew < -6.7e-32Initial program 99.8%
Applied rewrites93.6%
Taylor expanded in t around 0
lower-/.f6452.9
Applied rewrites52.9%
fabs-divN/A
metadata-evalN/A
remove-double-divN/A
lower-fabs.f6453.0
Applied rewrites53.0%
if -6.7e-32 < ew < 8e6Initial program 99.8%
Applied rewrites58.4%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6466.9
Applied rewrites66.9%
if 8e6 < ew Initial program 99.7%
Applied rewrites99.7%
Applied rewrites53.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6466.7
Applied rewrites66.7%
Final simplification62.4%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (* (sin t) eh))) (if (<= t -7e+29) t_1 (if (<= t 3400.0) (fabs ew) t_1))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (t <= -7e+29) {
tmp = t_1;
} else if (t <= 3400.0) {
tmp = fabs(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) :: tmp
t_1 = sin(t) * eh
if (t <= (-7d+29)) then
tmp = t_1
else if (t <= 3400.0d0) then
tmp = abs(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.sin(t) * eh;
double tmp;
if (t <= -7e+29) {
tmp = t_1;
} else if (t <= 3400.0) {
tmp = Math.abs(ew);
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * eh tmp = 0 if t <= -7e+29: tmp = t_1 elif t <= 3400.0: tmp = math.fabs(ew) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (t <= -7e+29) tmp = t_1; elseif (t <= 3400.0) tmp = abs(ew); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * eh; tmp = 0.0; if (t <= -7e+29) tmp = t_1; elseif (t <= 3400.0) tmp = abs(ew); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[t, -7e+29], t$95$1, If[LessEqual[t, 3400.0], N[Abs[ew], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;t \leq -7 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3400:\\
\;\;\;\;\left|ew\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.99999999999999958e29 or 3400 < t Initial program 99.5%
Applied rewrites99.5%
Applied rewrites33.1%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-sin.f6427.9
Applied rewrites27.9%
if -6.99999999999999958e29 < t < 3400Initial program 100.0%
Applied rewrites83.3%
Taylor expanded in t around 0
lower-/.f6466.2
Applied rewrites66.2%
fabs-divN/A
metadata-evalN/A
remove-double-divN/A
lower-fabs.f6466.4
Applied rewrites66.4%
Final simplification48.7%
(FPCore (eh ew t)
:precision binary64
(if (<= eh 5.2e+112)
(fabs ew)
(*
t
(fma
(* t t)
(fma (* eh (* t t)) -0.008333333333333333 (* eh 0.16666666666666666))
(- eh)))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= 5.2e+112) {
tmp = fabs(ew);
} else {
tmp = t * fma((t * t), fma((eh * (t * t)), -0.008333333333333333, (eh * 0.16666666666666666)), -eh);
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (eh <= 5.2e+112) tmp = abs(ew); else tmp = Float64(t * fma(Float64(t * t), fma(Float64(eh * Float64(t * t)), -0.008333333333333333, Float64(eh * 0.16666666666666666)), Float64(-eh))); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[eh, 5.2e+112], N[Abs[ew], $MachinePrecision], N[(t * N[(N[(t * t), $MachinePrecision] * N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] * -0.008333333333333333 + N[(eh * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + (-eh)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\
\;\;\;\;\left|ew\right|\\
\mathbf{else}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), -0.008333333333333333, eh \cdot 0.16666666666666666\right), -eh\right)\\
\end{array}
\end{array}
if eh < 5.2000000000000001e112Initial program 99.8%
Applied rewrites83.6%
Taylor expanded in t around 0
lower-/.f6446.4
Applied rewrites46.4%
fabs-divN/A
metadata-evalN/A
remove-double-divN/A
lower-fabs.f6446.5
Applied rewrites46.5%
if 5.2000000000000001e112 < eh Initial program 99.7%
Applied rewrites99.7%
Applied rewrites3.8%
Taylor expanded in eh around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
mul-1-negN/A
lower-neg.f6448.3
Applied rewrites48.3%
Taylor expanded in t around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6430.4
Applied rewrites30.4%
(FPCore (eh ew t)
:precision binary64
(if (<= eh 5.2e+112)
(fabs ew)
(*
eh
(*
(- t)
(fma
(* t t)
(fma (* t t) 0.008333333333333333 -0.16666666666666666)
1.0)))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= 5.2e+112) {
tmp = fabs(ew);
} else {
tmp = eh * (-t * fma((t * t), fma((t * t), 0.008333333333333333, -0.16666666666666666), 1.0));
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (eh <= 5.2e+112) tmp = abs(ew); else tmp = Float64(eh * Float64(Float64(-t) * fma(Float64(t * t), fma(Float64(t * t), 0.008333333333333333, -0.16666666666666666), 1.0))); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[eh, 5.2e+112], N[Abs[ew], $MachinePrecision], N[(eh * N[((-t) * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\
\;\;\;\;\left|ew\right|\\
\mathbf{else}:\\
\;\;\;\;eh \cdot \left(\left(-t\right) \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\
\end{array}
\end{array}
if eh < 5.2000000000000001e112Initial program 99.8%
Applied rewrites83.6%
Taylor expanded in t around 0
lower-/.f6446.4
Applied rewrites46.4%
fabs-divN/A
metadata-evalN/A
remove-double-divN/A
lower-fabs.f6446.5
Applied rewrites46.5%
if 5.2000000000000001e112 < eh Initial program 99.7%
Applied rewrites99.7%
Applied rewrites3.8%
Taylor expanded in eh around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
mul-1-negN/A
lower-neg.f6448.3
Applied rewrites48.3%
Taylor expanded in t around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6430.3
Applied rewrites30.3%
Final simplification44.0%
(FPCore (eh ew t) :precision binary64 (if (<= eh 5.2e+112) (fabs ew) (* t (- (* (* eh (* t t)) 0.16666666666666666) eh))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= 5.2e+112) {
tmp = fabs(ew);
} else {
tmp = t * (((eh * (t * t)) * 0.16666666666666666) - eh);
}
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 <= 5.2d+112) then
tmp = abs(ew)
else
tmp = t * (((eh * (t * t)) * 0.16666666666666666d0) - eh)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (eh <= 5.2e+112) {
tmp = Math.abs(ew);
} else {
tmp = t * (((eh * (t * t)) * 0.16666666666666666) - eh);
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= 5.2e+112: tmp = math.fabs(ew) else: tmp = t * (((eh * (t * t)) * 0.16666666666666666) - eh) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= 5.2e+112) tmp = abs(ew); else tmp = Float64(t * Float64(Float64(Float64(eh * Float64(t * t)) * 0.16666666666666666) - eh)); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= 5.2e+112) tmp = abs(ew); else tmp = t * (((eh * (t * t)) * 0.16666666666666666) - eh); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, 5.2e+112], N[Abs[ew], $MachinePrecision], N[(t * N[(N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - eh), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq 5.2 \cdot 10^{+112}:\\
\;\;\;\;\left|ew\right|\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(eh \cdot \left(t \cdot t\right)\right) \cdot 0.16666666666666666 - eh\right)\\
\end{array}
\end{array}
if eh < 5.2000000000000001e112Initial program 99.8%
Applied rewrites83.6%
Taylor expanded in t around 0
lower-/.f6446.4
Applied rewrites46.4%
fabs-divN/A
metadata-evalN/A
remove-double-divN/A
lower-fabs.f6446.5
Applied rewrites46.5%
if 5.2000000000000001e112 < eh Initial program 99.7%
Applied rewrites99.7%
Applied rewrites3.8%
Taylor expanded in eh around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
mul-1-negN/A
lower-neg.f6448.3
Applied rewrites48.3%
Taylor expanded in t around 0
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.8
Applied rewrites29.8%
Final simplification43.9%
(FPCore (eh ew t) :precision binary64 (if (<= eh 1.28e+113) (fabs ew) (* t (- eh))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= 1.28e+113) {
tmp = fabs(ew);
} else {
tmp = t * -eh;
}
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 <= 1.28d+113) then
tmp = abs(ew)
else
tmp = t * -eh
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (eh <= 1.28e+113) {
tmp = Math.abs(ew);
} else {
tmp = t * -eh;
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= 1.28e+113: tmp = math.fabs(ew) else: tmp = t * -eh return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= 1.28e+113) tmp = abs(ew); else tmp = Float64(t * Float64(-eh)); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= 1.28e+113) tmp = abs(ew); else tmp = t * -eh; end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, 1.28e+113], N[Abs[ew], $MachinePrecision], N[(t * (-eh)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq 1.28 \cdot 10^{+113}:\\
\;\;\;\;\left|ew\right|\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-eh\right)\\
\end{array}
\end{array}
if eh < 1.27999999999999994e113Initial program 99.8%
Applied rewrites83.6%
Taylor expanded in t around 0
lower-/.f6446.4
Applied rewrites46.4%
fabs-divN/A
metadata-evalN/A
remove-double-divN/A
lower-fabs.f6446.5
Applied rewrites46.5%
if 1.27999999999999994e113 < eh Initial program 99.7%
Applied rewrites99.7%
Applied rewrites3.8%
Taylor expanded in eh around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
mul-1-negN/A
lower-neg.f6448.3
Applied rewrites48.3%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6429.3
Applied rewrites29.3%
(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%
Applied rewrites77.6%
Taylor expanded in t around 0
lower-/.f6441.6
Applied rewrites41.6%
fabs-divN/A
metadata-evalN/A
remove-double-divN/A
lower-fabs.f6441.7
Applied rewrites41.7%
(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 rewrites77.6%
Taylor expanded in t around 0
lower-/.f6441.6
Applied rewrites41.6%
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
pow-flipN/A
metadata-evalN/A
unpow120.2
Applied rewrites20.2%
herbie shell --seed 2024214
(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)))))))