
(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 (atan (/ (* (tan t) eh) (- ew))))) (fabs (- (* (* (sin t) eh) (sin t_1)) (* (cos t_1) (* (cos t) ew))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((tan(t) * eh) / -ew));
return fabs((((sin(t) * eh) * sin(t_1)) - (cos(t_1) * (cos(t) * ew))));
}
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(((tan(t) * eh) / -ew))
code = abs((((sin(t) * eh) * sin(t_1)) - (cos(t_1) * (cos(t) * ew))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((Math.tan(t) * eh) / -ew));
return Math.abs((((Math.sin(t) * eh) * Math.sin(t_1)) - (Math.cos(t_1) * (Math.cos(t) * ew))));
}
def code(eh, ew, t): t_1 = math.atan(((math.tan(t) * eh) / -ew)) return math.fabs((((math.sin(t) * eh) * math.sin(t_1)) - (math.cos(t_1) * (math.cos(t) * ew))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(tan(t) * eh) / Float64(-ew))) return abs(Float64(Float64(Float64(sin(t) * eh) * sin(t_1)) - Float64(cos(t_1) * Float64(cos(t) * ew)))) end
function tmp = code(eh, ew, t) t_1 = atan(((tan(t) * eh) / -ew)); tmp = abs((((sin(t) * eh) * sin(t_1)) - (cos(t_1) * (cos(t) * ew)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\tan t \cdot eh}{-ew}\right)\\
\left|\left(\sin t \cdot eh\right) \cdot \sin t\_1 - \cos t\_1 \cdot \left(\cos t \cdot ew\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (tan t) eh)))
(fabs
(-
(* (* (sin t) eh) (sin (atan (/ t_1 (- ew)))))
(* (/ (cos t) (sqrt (+ (pow (/ t_1 ew) 2.0) 1.0))) ew)))))
double code(double eh, double ew, double t) {
double t_1 = tan(t) * eh;
return fabs((((sin(t) * eh) * sin(atan((t_1 / -ew)))) - ((cos(t) / sqrt((pow((t_1 / ew), 2.0) + 1.0))) * ew)));
}
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 = tan(t) * eh
code = abs((((sin(t) * eh) * sin(atan((t_1 / -ew)))) - ((cos(t) / sqrt((((t_1 / ew) ** 2.0d0) + 1.0d0))) * ew)))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.tan(t) * eh;
return Math.abs((((Math.sin(t) * eh) * Math.sin(Math.atan((t_1 / -ew)))) - ((Math.cos(t) / Math.sqrt((Math.pow((t_1 / ew), 2.0) + 1.0))) * ew)));
}
def code(eh, ew, t): t_1 = math.tan(t) * eh return math.fabs((((math.sin(t) * eh) * math.sin(math.atan((t_1 / -ew)))) - ((math.cos(t) / math.sqrt((math.pow((t_1 / ew), 2.0) + 1.0))) * ew)))
function code(eh, ew, t) t_1 = Float64(tan(t) * eh) return abs(Float64(Float64(Float64(sin(t) * eh) * sin(atan(Float64(t_1 / Float64(-ew))))) - Float64(Float64(cos(t) / sqrt(Float64((Float64(t_1 / ew) ^ 2.0) + 1.0))) * ew))) end
function tmp = code(eh, ew, t) t_1 = tan(t) * eh; tmp = abs((((sin(t) * eh) * sin(atan((t_1 / -ew)))) - ((cos(t) / sqrt((((t_1 / ew) ^ 2.0) + 1.0))) * ew))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision]}, N[Abs[N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(t$95$1 / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(t$95$1 / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan t \cdot eh\\
\left|\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t\_1}{-ew}\right) - \frac{\cos t}{\sqrt{{\left(\frac{t\_1}{ew}\right)}^{2} + 1}} \cdot ew\right|
\end{array}
\end{array}
Initial program 99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (* (sin t) eh) (sin (atan (* (/ (- t) ew) eh)))) (* (cos (atan (/ (* (tan t) eh) (- ew)))) (* (cos t) ew)))))
double code(double eh, double ew, double t) {
return fabs((((sin(t) * eh) * sin(atan(((-t / ew) * eh)))) - (cos(atan(((tan(t) * eh) / -ew))) * (cos(t) * 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((((sin(t) * eh) * sin(atan(((-t / ew) * eh)))) - (cos(atan(((tan(t) * eh) / -ew))) * (cos(t) * ew))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((Math.sin(t) * eh) * Math.sin(Math.atan(((-t / ew) * eh)))) - (Math.cos(Math.atan(((Math.tan(t) * eh) / -ew))) * (Math.cos(t) * ew))));
}
def code(eh, ew, t): return math.fabs((((math.sin(t) * eh) * math.sin(math.atan(((-t / ew) * eh)))) - (math.cos(math.atan(((math.tan(t) * eh) / -ew))) * (math.cos(t) * ew))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(Float64(-t) / ew) * eh)))) - Float64(cos(atan(Float64(Float64(tan(t) * eh) / Float64(-ew)))) * Float64(cos(t) * ew)))) end
function tmp = code(eh, ew, t) tmp = abs((((sin(t) * eh) * sin(atan(((-t / ew) * eh)))) - (cos(atan(((tan(t) * eh) / -ew))) * (cos(t) * ew)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-t) / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{-t}{ew} \cdot eh\right) - \cos \tan^{-1} \left(\frac{\tan t \cdot eh}{-ew}\right) \cdot \left(\cos t \cdot ew\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*l/N/A
*-commutativeN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6498.4
Applied rewrites98.4%
Final simplification98.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) ew)) (t_2 (fabs t_1)) (t_3 (* (sin t) eh)))
(if (<= ew -2.2e-25)
t_2
(if (<= ew 3.15e-183)
(fabs t_3)
(if (<= ew 3.9e-41)
(/
(fma (/ (tan t) ew) (* t_3 eh) t_1)
(sqrt (+ (pow (/ (* (tan t) eh) ew) 2.0) 1.0)))
t_2)))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * ew;
double t_2 = fabs(t_1);
double t_3 = sin(t) * eh;
double tmp;
if (ew <= -2.2e-25) {
tmp = t_2;
} else if (ew <= 3.15e-183) {
tmp = fabs(t_3);
} else if (ew <= 3.9e-41) {
tmp = fma((tan(t) / ew), (t_3 * eh), t_1) / sqrt((pow(((tan(t) * eh) / ew), 2.0) + 1.0));
} else {
tmp = t_2;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(cos(t) * ew) t_2 = abs(t_1) t_3 = Float64(sin(t) * eh) tmp = 0.0 if (ew <= -2.2e-25) tmp = t_2; elseif (ew <= 3.15e-183) tmp = abs(t_3); elseif (ew <= 3.9e-41) tmp = Float64(fma(Float64(tan(t) / ew), Float64(t_3 * eh), t_1) / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) + 1.0))); else tmp = t_2; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[Abs[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[ew, -2.2e-25], t$95$2, If[LessEqual[ew, 3.15e-183], N[Abs[t$95$3], $MachinePrecision], If[LessEqual[ew, 3.9e-41], N[(N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * N[(t$95$3 * eh), $MachinePrecision] + t$95$1), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot ew\\
t_2 := \left|t\_1\right|\\
t_3 := \sin t \cdot eh\\
\mathbf{if}\;ew \leq -2.2 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 3.15 \cdot 10^{-183}:\\
\;\;\;\;\left|t\_3\right|\\
\mathbf{elif}\;ew \leq 3.9 \cdot 10^{-41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\tan t}{ew}, t\_3 \cdot eh, t\_1\right)}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -2.2000000000000002e-25 or 3.89999999999999991e-41 < ew Initial program 99.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.8%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6483.7
Applied rewrites83.7%
if -2.2000000000000002e-25 < ew < 3.1499999999999999e-183Initial program 99.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites50.3%
Taylor expanded in eh around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6474.0
Applied rewrites74.0%
if 3.1499999999999999e-183 < ew < 3.89999999999999991e-41Initial program 99.7%
Applied rewrites83.1%
Applied rewrites83.1%
Applied rewrites67.9%
Final simplification78.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -1.6e+166)
(fabs
(fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
(if (<= eh 7.5e+190)
(fabs
(/
(+ (* (* (/ (tan t) ew) eh) t_1) (* (cos t) ew))
(sqrt (+ (pow (/ (- ew) (* (tan t) eh)) -2.0) 1.0))))
(fabs t_1)))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -1.6e+166) {
tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
} else if (eh <= 7.5e+190) {
tmp = fabs((((((tan(t) / ew) * eh) * t_1) + (cos(t) * ew)) / sqrt((pow((-ew / (tan(t) * eh)), -2.0) + 1.0))));
} else {
tmp = fabs(t_1);
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -1.6e+166) tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh)))); elseif (eh <= 7.5e+190) tmp = abs(Float64(Float64(Float64(Float64(Float64(tan(t) / ew) * eh) * t_1) + Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(-ew) / Float64(tan(t) * eh)) ^ -2.0) + 1.0)))); else tmp = abs(t_1); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -1.6e+166], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 7.5e+190], N[Abs[N[(N[(N[(N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[((-ew) / N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -1.6 \cdot 10^{+166}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
\mathbf{elif}\;eh \leq 7.5 \cdot 10^{+190}:\\
\;\;\;\;\left|\frac{\left(\frac{\tan t}{ew} \cdot eh\right) \cdot t\_1 + \cos t \cdot ew}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if eh < -1.59999999999999984e166Initial program 99.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites45.1%
Taylor expanded in ew around 0
+-commutativeN/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites74.6%
if -1.59999999999999984e166 < eh < 7.4999999999999994e190Initial program 99.8%
Applied rewrites88.5%
if 7.4999999999999994e190 < eh Initial program 99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites24.5%
Taylor expanded in eh around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6489.2
Applied rewrites89.2%
Final simplification87.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -5.4e+177)
(fabs
(fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
(if (<= eh 5.8e+190)
(fabs
(/
(fma (- (cos t)) ew (* (* (/ (- eh) ew) (tan t)) t_1))
(sqrt (+ (pow (/ (* (tan t) eh) ew) 2.0) 1.0))))
(fabs t_1)))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -5.4e+177) {
tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
} else if (eh <= 5.8e+190) {
tmp = fabs((fma(-cos(t), ew, (((-eh / ew) * tan(t)) * t_1)) / sqrt((pow(((tan(t) * eh) / ew), 2.0) + 1.0))));
} else {
tmp = fabs(t_1);
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -5.4e+177) tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh)))); elseif (eh <= 5.8e+190) tmp = abs(Float64(fma(Float64(-cos(t)), ew, Float64(Float64(Float64(Float64(-eh) / ew) * tan(t)) * t_1)) / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) + 1.0)))); else tmp = abs(t_1); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -5.4e+177], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 5.8e+190], N[Abs[N[(N[((-N[Cos[t], $MachinePrecision]) * ew + N[(N[(N[((-eh) / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -5.4 \cdot 10^{+177}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
\mathbf{elif}\;eh \leq 5.8 \cdot 10^{+190}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(-\cos t, ew, \left(\frac{-eh}{ew} \cdot \tan t\right) \cdot t\_1\right)}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if eh < -5.39999999999999982e177Initial program 99.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites43.2%
Taylor expanded in ew around 0
+-commutativeN/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites73.7%
if -5.39999999999999982e177 < eh < 5.79999999999999979e190Initial program 99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites88.5%
Applied rewrites88.5%
if 5.79999999999999979e190 < eh Initial program 99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites24.5%
Taylor expanded in eh around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6489.2
Applied rewrites89.2%
Final simplification87.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -5.4e+177)
(fabs
(fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
(if (<= eh 5.8e+190)
(fabs
(/
(+ (* (* (/ eh ew) (tan t)) t_1) (* (cos t) ew))
(sqrt (+ (pow (/ (* (tan t) eh) ew) 2.0) 1.0))))
(fabs t_1)))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -5.4e+177) {
tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
} else if (eh <= 5.8e+190) {
tmp = fabs((((((eh / ew) * tan(t)) * t_1) + (cos(t) * ew)) / sqrt((pow(((tan(t) * eh) / ew), 2.0) + 1.0))));
} else {
tmp = fabs(t_1);
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -5.4e+177) tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh)))); elseif (eh <= 5.8e+190) tmp = abs(Float64(Float64(Float64(Float64(Float64(eh / ew) * tan(t)) * t_1) + Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) + 1.0)))); else tmp = abs(t_1); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -5.4e+177], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 5.8e+190], N[Abs[N[(N[(N[(N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -5.4 \cdot 10^{+177}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
\mathbf{elif}\;eh \leq 5.8 \cdot 10^{+190}:\\
\;\;\;\;\left|\frac{\left(\frac{eh}{ew} \cdot \tan t\right) \cdot t\_1 + \cos t \cdot ew}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if eh < -5.39999999999999982e177Initial program 99.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites43.2%
Taylor expanded in ew around 0
+-commutativeN/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites73.7%
if -5.39999999999999982e177 < eh < 5.79999999999999979e190Initial program 99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites88.5%
if 5.79999999999999979e190 < eh Initial program 99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites24.5%
Taylor expanded in eh around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6489.2
Applied rewrites89.2%
Final simplification87.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -2.1e+131)
(fabs
(fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
(if (<= eh 4.8e+179)
(fabs
(/
(fma (* t_1 eh) (/ (tan t) ew) (* (cos t) ew))
(sqrt (+ (pow (/ (- ew) (* (tan t) eh)) -2.0) 1.0))))
(fabs t_1)))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -2.1e+131) {
tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
} else if (eh <= 4.8e+179) {
tmp = fabs((fma((t_1 * eh), (tan(t) / ew), (cos(t) * ew)) / sqrt((pow((-ew / (tan(t) * eh)), -2.0) + 1.0))));
} else {
tmp = fabs(t_1);
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -2.1e+131) tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh)))); elseif (eh <= 4.8e+179) tmp = abs(Float64(fma(Float64(t_1 * eh), Float64(tan(t) / ew), Float64(cos(t) * ew)) / sqrt(Float64((Float64(Float64(-ew) / Float64(tan(t) * eh)) ^ -2.0) + 1.0)))); else tmp = abs(t_1); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -2.1e+131], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 4.8e+179], N[Abs[N[(N[(N[(t$95$1 * eh), $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[Power[N[((-ew) / N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -2.1 \cdot 10^{+131}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
\mathbf{elif}\;eh \leq 4.8 \cdot 10^{+179}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \frac{\tan t}{ew}, \cos t \cdot ew\right)}{\sqrt{{\left(\frac{-ew}{\tan t \cdot eh}\right)}^{-2} + 1}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if eh < -2.09999999999999985e131Initial program 99.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites48.9%
Taylor expanded in ew around 0
+-commutativeN/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites71.3%
if -2.09999999999999985e131 < eh < 4.80000000000000025e179Initial program 99.8%
Applied rewrites88.9%
Applied rewrites86.7%
if 4.80000000000000025e179 < eh Initial program 99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites29.9%
Taylor expanded in eh around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6486.8
Applied rewrites86.8%
Final simplification84.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -2.1e+131)
(fabs
(fma (/ (* (pow (cos t) 2.0) -0.5) t_1) (* ew ew) (* (sin t) (- eh))))
(if (<= eh 4.8e+179)
(/
(fabs (fma (/ (tan t) ew) (* t_1 eh) (* (cos t) ew)))
(sqrt (+ (pow (/ (* (tan t) eh) ew) 2.0) 1.0)))
(fabs t_1)))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -2.1e+131) {
tmp = fabs(fma(((pow(cos(t), 2.0) * -0.5) / t_1), (ew * ew), (sin(t) * -eh)));
} else if (eh <= 4.8e+179) {
tmp = fabs(fma((tan(t) / ew), (t_1 * eh), (cos(t) * ew))) / sqrt((pow(((tan(t) * eh) / ew), 2.0) + 1.0));
} else {
tmp = fabs(t_1);
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -2.1e+131) tmp = abs(fma(Float64(Float64((cos(t) ^ 2.0) * -0.5) / t_1), Float64(ew * ew), Float64(sin(t) * Float64(-eh)))); elseif (eh <= 4.8e+179) tmp = Float64(abs(fma(Float64(tan(t) / ew), Float64(t_1 * eh), Float64(cos(t) * ew))) / sqrt(Float64((Float64(Float64(tan(t) * eh) / ew) ^ 2.0) + 1.0))); else tmp = abs(t_1); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -2.1e+131], N[Abs[N[(N[(N[(N[Power[N[Cos[t], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(ew * ew), $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 4.8e+179], N[(N[Abs[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * N[(t$95$1 * eh), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -2.1 \cdot 10^{+131}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{{\cos t}^{2} \cdot -0.5}{t\_1}, ew \cdot ew, \sin t \cdot \left(-eh\right)\right)\right|\\
\mathbf{elif}\;eh \leq 4.8 \cdot 10^{+179}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(\frac{\tan t}{ew}, t\_1 \cdot eh, \cos t \cdot ew\right)\right|}{\sqrt{{\left(\frac{\tan t \cdot eh}{ew}\right)}^{2} + 1}}\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if eh < -2.09999999999999985e131Initial program 99.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites48.9%
Taylor expanded in ew around 0
+-commutativeN/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites71.3%
if -2.09999999999999985e131 < eh < 4.80000000000000025e179Initial program 99.8%
Applied rewrites88.9%
Applied rewrites86.2%
Applied rewrites86.7%
if 4.80000000000000025e179 < eh Initial program 99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites29.9%
Taylor expanded in eh around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6486.8
Applied rewrites86.8%
Final simplification84.6%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* (cos t) ew)))) (if (<= ew -2.2e-25) t_1 (if (<= ew 1.6e-107) (fabs (* (sin t) eh)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((cos(t) * ew));
double tmp;
if (ew <= -2.2e-25) {
tmp = t_1;
} else if (ew <= 1.6e-107) {
tmp = fabs((sin(t) * eh));
} 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((cos(t) * ew))
if (ew <= (-2.2d-25)) then
tmp = t_1
else if (ew <= 1.6d-107) then
tmp = abs((sin(t) * eh))
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.cos(t) * ew));
double tmp;
if (ew <= -2.2e-25) {
tmp = t_1;
} else if (ew <= 1.6e-107) {
tmp = Math.abs((Math.sin(t) * eh));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.cos(t) * ew)) tmp = 0 if ew <= -2.2e-25: tmp = t_1 elif ew <= 1.6e-107: tmp = math.fabs((math.sin(t) * eh)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(cos(t) * ew)) tmp = 0.0 if (ew <= -2.2e-25) tmp = t_1; elseif (ew <= 1.6e-107) tmp = abs(Float64(sin(t) * eh)); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((cos(t) * ew)); tmp = 0.0; if (ew <= -2.2e-25) tmp = t_1; elseif (ew <= 1.6e-107) tmp = abs((sin(t) * eh)); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.2e-25], t$95$1, If[LessEqual[ew, 1.6e-107], N[Abs[N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\cos t \cdot ew\right|\\
\mathbf{if}\;ew \leq -2.2 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 1.6 \cdot 10^{-107}:\\
\;\;\;\;\left|\sin t \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -2.2000000000000002e-25 or 1.60000000000000006e-107 < ew Initial program 99.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.8%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6479.9
Applied rewrites79.9%
if -2.2000000000000002e-25 < ew < 1.60000000000000006e-107Initial program 99.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.9%
Applied rewrites53.9%
Taylor expanded in eh around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6472.2
Applied rewrites72.2%
(FPCore (eh ew t) :precision binary64 (fabs (* (cos t) ew)))
double code(double eh, double ew, double t) {
return fabs((cos(t) * 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((cos(t) * ew))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((Math.cos(t) * ew));
}
def code(eh, ew, t): return math.fabs((math.cos(t) * ew))
function code(eh, ew, t) return abs(Float64(cos(t) * ew)) end
function tmp = code(eh, ew, t) tmp = abs((cos(t) * ew)); end
code[eh_, ew_, t_] := N[Abs[N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\cos t \cdot ew\right|
\end{array}
Initial program 99.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.8%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6461.8
Applied rewrites61.8%
(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(Float64(-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%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.8%
Applied rewrites77.1%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6441.6
Applied rewrites41.6%
herbie shell --seed 2024235
(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)))))))