
(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 11 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 (fabs (- (/ (* ew (cos t)) (hypot 1.0 (/ (tan t) (/ ew eh)))) (* (* eh (sin t)) (sin (atan (/ (* (tan t) eh) (- 0.0 ew))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * cos(t)) / hypot(1.0, (tan(t) / (ew / eh)))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0 - ew)))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs((((ew * Math.cos(t)) / Math.hypot(1.0, (Math.tan(t) / (ew / eh)))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * eh) / (0.0 - ew)))))));
}
def code(eh, ew, t): return math.fabs((((ew * math.cos(t)) / math.hypot(1.0, (math.tan(t) / (ew / eh)))) - ((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * eh) / (0.0 - ew)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(ew * cos(t)) / hypot(1.0, Float64(tan(t) / Float64(ew / eh)))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * eh) / Float64(0.0 - ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((((ew * cos(t)) / hypot(1.0, (tan(t) / (ew / eh)))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0 - ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] / N[(ew / eh), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{0 - ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.8%
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (* ew (cos t)) (cos (atan (/ (* (tan t) eh) (- 0.0 ew))))) (* (* eh (sin t)) (sin (atan (/ (* t eh) (- 0.0 ew))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * cos(t)) * cos(atan(((tan(t) * eh) / (0.0 - ew))))) - ((eh * sin(t)) * sin(atan(((t * eh) / (0.0 - ew)))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((((ew * cos(t)) * cos(atan(((tan(t) * eh) / (0.0d0 - ew))))) - ((eh * sin(t)) * sin(atan(((t * eh) / (0.0d0 - ew)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((ew * Math.cos(t)) * Math.cos(Math.atan(((Math.tan(t) * eh) / (0.0 - ew))))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((t * eh) / (0.0 - ew)))))));
}
def code(eh, ew, t): return math.fabs((((ew * math.cos(t)) * math.cos(math.atan(((math.tan(t) * eh) / (0.0 - ew))))) - ((eh * math.sin(t)) * math.sin(math.atan(((t * eh) / (0.0 - ew)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(atan(Float64(Float64(tan(t) * eh) / Float64(0.0 - ew))))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * eh) / Float64(0.0 - ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((((ew * cos(t)) * cos(atan(((tan(t) * eh) / (0.0 - ew))))) - ((eh * sin(t)) * sin(atan(((t * eh) / (0.0 - ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\tan t \cdot eh}{0 - ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{0 - ew}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
Simplified99.4%
Final simplification99.4%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ ew (/ (hypot 1.0 (/ (tan t) (/ ew eh))) (cos t))) (* (* eh (sin t)) (sin (atan (/ (* (tan t) eh) (- 0.0 ew))))))))
double code(double eh, double ew, double t) {
return fabs(((ew / (hypot(1.0, (tan(t) / (ew / eh))) / cos(t))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0 - ew)))))));
}
public static double code(double eh, double ew, double t) {
return Math.abs(((ew / (Math.hypot(1.0, (Math.tan(t) / (ew / eh))) / Math.cos(t))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * eh) / (0.0 - ew)))))));
}
def code(eh, ew, t): return math.fabs(((ew / (math.hypot(1.0, (math.tan(t) / (ew / eh))) / math.cos(t))) - ((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * eh) / (0.0 - ew)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew / Float64(hypot(1.0, Float64(tan(t) / Float64(ew / eh))) / cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * eh) / Float64(0.0 - ew))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew / (hypot(1.0, (tan(t) / (ew / eh))) / cos(t))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0 - ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew / N[(N[Sqrt[1.0 ^ 2 + N[(N[Tan[t], $MachinePrecision] / N[(ew / eh), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{\tan t}{\frac{ew}{eh}}\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{0 - ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.8%
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f6499.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ ew (/ 1.0 (cos t))) (* (* eh (sin t)) (sin (atan (/ (* (tan t) eh) (- 0.0 ew))))))))
double code(double eh, double ew, double t) {
return fabs(((ew / (1.0 / cos(t))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0 - 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 / (1.0d0 / cos(t))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0d0 - ew)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew / (1.0 / Math.cos(t))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * eh) / (0.0 - ew)))))));
}
def code(eh, ew, t): return math.fabs(((ew / (1.0 / math.cos(t))) - ((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * eh) / (0.0 - ew)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew / Float64(1.0 / cos(t))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * eh) / Float64(0.0 - ew))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew / (1.0 / cos(t))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0 - ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew / N[(1.0 / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{\frac{1}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{0 - ew}\right)\right|
\end{array}
Initial program 99.8%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.8%
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
hypot-undefineN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f6499.7%
Applied egg-rr99.7%
Taylor expanded in ew around inf
/-lowering-/.f64N/A
cos-lowering-cos.f6498.8%
Simplified98.8%
Final simplification98.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(-
(/ ew (+ 1.0 (/ (* (/ 0.5 ew) (* eh (* eh (* t t)))) ew)))
(* (* eh (sin t)) (sin (atan (/ (* (tan t) eh) (- 0.0 ew)))))))))
(if (<= eh -1.05e-139) t_1 (if (<= eh 2.7e-36) (fabs (* ew (cos t))) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs(((ew / (1.0 + (((0.5 / ew) * (eh * (eh * (t * t)))) / ew))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0 - ew)))))));
double tmp;
if (eh <= -1.05e-139) {
tmp = t_1;
} else if (eh <= 2.7e-36) {
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(((ew / (1.0d0 + (((0.5d0 / ew) * (eh * (eh * (t * t)))) / ew))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0d0 - ew)))))))
if (eh <= (-1.05d-139)) then
tmp = t_1
else if (eh <= 2.7d-36) 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(((ew / (1.0 + (((0.5 / ew) * (eh * (eh * (t * t)))) / ew))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((Math.tan(t) * eh) / (0.0 - ew)))))));
double tmp;
if (eh <= -1.05e-139) {
tmp = t_1;
} else if (eh <= 2.7e-36) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs(((ew / (1.0 + (((0.5 / ew) * (eh * (eh * (t * t)))) / ew))) - ((eh * math.sin(t)) * math.sin(math.atan(((math.tan(t) * eh) / (0.0 - ew))))))) tmp = 0 if eh <= -1.05e-139: tmp = t_1 elif eh <= 2.7e-36: tmp = math.fabs((ew * math.cos(t))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(Float64(ew / Float64(1.0 + Float64(Float64(Float64(0.5 / ew) * Float64(eh * Float64(eh * Float64(t * t)))) / ew))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(tan(t) * eh) / Float64(0.0 - ew))))))) tmp = 0.0 if (eh <= -1.05e-139) tmp = t_1; elseif (eh <= 2.7e-36) tmp = abs(Float64(ew * cos(t))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs(((ew / (1.0 + (((0.5 / ew) * (eh * (eh * (t * t)))) / ew))) - ((eh * sin(t)) * sin(atan(((tan(t) * eh) / (0.0 - ew))))))); tmp = 0.0; if (eh <= -1.05e-139) tmp = t_1; elseif (eh <= 2.7e-36) 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[(ew / N[(1.0 + N[(N[(N[(0.5 / ew), $MachinePrecision] * N[(eh * N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.05e-139], t$95$1, If[LessEqual[eh, 2.7e-36], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\frac{ew}{1 + \frac{\frac{0.5}{ew} \cdot \left(eh \cdot \left(eh \cdot \left(t \cdot t\right)\right)\right)}{ew}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\tan t \cdot eh}{0 - ew}\right)\right|\\
\mathbf{if}\;eh \leq -1.05 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 2.7 \cdot 10^{-36}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -1.05000000000000004e-139 or 2.70000000000000007e-36 < eh Initial program 99.8%
Taylor expanded in t around 0
Simplified88.4%
cos-atanN/A
un-div-invN/A
frac-timesN/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
*-commutativeN/A
sqr-negN/A
frac-timesN/A
metadata-evalN/A
Applied egg-rr88.4%
Taylor expanded in t around 0
+-lowering-+.f64N/A
associate-*r/N/A
unpow2N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.6%
Simplified75.6%
associate-*r/N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6485.5%
Applied egg-rr85.5%
if -1.05000000000000004e-139 < eh < 2.70000000000000007e-36Initial program 99.8%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6489.1%
Simplified89.1%
Final simplification87.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= ew -1.36e-108)
t_1
(if (<= ew 1120000000.0)
(fabs
(-
(/ ew (+ 1.0 (* (/ 0.5 ew) (* (* eh eh) (/ (* t t) ew)))))
(* (* eh (sin t)) (sin (atan (/ (* t eh) (- 0.0 ew)))))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (ew <= -1.36e-108) {
tmp = t_1;
} else if (ew <= 1120000000.0) {
tmp = fabs(((ew / (1.0 + ((0.5 / ew) * ((eh * eh) * ((t * t) / ew))))) - ((eh * sin(t)) * sin(atan(((t * eh) / (0.0 - 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 = abs((ew * cos(t)))
if (ew <= (-1.36d-108)) then
tmp = t_1
else if (ew <= 1120000000.0d0) then
tmp = abs(((ew / (1.0d0 + ((0.5d0 / ew) * ((eh * eh) * ((t * t) / ew))))) - ((eh * sin(t)) * sin(atan(((t * eh) / (0.0d0 - ew)))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.cos(t)));
double tmp;
if (ew <= -1.36e-108) {
tmp = t_1;
} else if (ew <= 1120000000.0) {
tmp = Math.abs(((ew / (1.0 + ((0.5 / ew) * ((eh * eh) * ((t * t) / ew))))) - ((eh * Math.sin(t)) * Math.sin(Math.atan(((t * eh) / (0.0 - ew)))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if ew <= -1.36e-108: tmp = t_1 elif ew <= 1120000000.0: tmp = math.fabs(((ew / (1.0 + ((0.5 / ew) * ((eh * eh) * ((t * t) / ew))))) - ((eh * math.sin(t)) * math.sin(math.atan(((t * eh) / (0.0 - ew))))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (ew <= -1.36e-108) tmp = t_1; elseif (ew <= 1120000000.0) tmp = abs(Float64(Float64(ew / Float64(1.0 + Float64(Float64(0.5 / ew) * Float64(Float64(eh * eh) * Float64(Float64(t * t) / ew))))) - Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * eh) / Float64(0.0 - ew))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * cos(t))); tmp = 0.0; if (ew <= -1.36e-108) tmp = t_1; elseif (ew <= 1120000000.0) tmp = abs(((ew / (1.0 + ((0.5 / ew) * ((eh * eh) * ((t * t) / ew))))) - ((eh * sin(t)) * sin(atan(((t * eh) / (0.0 - ew))))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.36e-108], t$95$1, If[LessEqual[ew, 1120000000.0], N[Abs[N[(N[(ew / N[(1.0 + N[(N[(0.5 / ew), $MachinePrecision] * N[(N[(eh * eh), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;ew \leq -1.36 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 1120000000:\\
\;\;\;\;\left|\frac{ew}{1 + \frac{0.5}{ew} \cdot \left(\left(eh \cdot eh\right) \cdot \frac{t \cdot t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{0 - ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -1.36000000000000005e-108 or 1.12e9 < ew Initial program 99.8%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6482.2%
Simplified82.2%
if -1.36000000000000005e-108 < ew < 1.12e9Initial program 99.8%
Taylor expanded in t around 0
Simplified91.9%
cos-atanN/A
un-div-invN/A
frac-timesN/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
*-commutativeN/A
sqr-negN/A
frac-timesN/A
metadata-evalN/A
Applied egg-rr91.9%
Taylor expanded in t around 0
+-lowering-+.f64N/A
associate-*r/N/A
unpow2N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6484.3%
Simplified84.3%
Taylor expanded in t around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6484.3%
Simplified84.3%
Final simplification83.2%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* (* eh (sin t)) (sin (atan (/ (* t eh) (- 0.0 ew)))))))) (if (<= eh -5.5e+58) t_1 (if (<= eh 5.5e+80) (fabs (* ew (cos t))) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs(((eh * sin(t)) * sin(atan(((t * eh) / (0.0 - ew))))));
double tmp;
if (eh <= -5.5e+58) {
tmp = t_1;
} else if (eh <= 5.5e+80) {
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(((eh * sin(t)) * sin(atan(((t * eh) / (0.0d0 - ew))))))
if (eh <= (-5.5d+58)) then
tmp = t_1
else if (eh <= 5.5d+80) 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(((eh * Math.sin(t)) * Math.sin(Math.atan(((t * eh) / (0.0 - ew))))));
double tmp;
if (eh <= -5.5e+58) {
tmp = t_1;
} else if (eh <= 5.5e+80) {
tmp = Math.abs((ew * Math.cos(t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs(((eh * math.sin(t)) * math.sin(math.atan(((t * eh) / (0.0 - ew)))))) tmp = 0 if eh <= -5.5e+58: tmp = t_1 elif eh <= 5.5e+80: tmp = math.fabs((ew * math.cos(t))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(t * eh) / Float64(0.0 - ew)))))) tmp = 0.0 if (eh <= -5.5e+58) tmp = t_1; elseif (eh <= 5.5e+80) tmp = abs(Float64(ew * cos(t))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs(((eh * sin(t)) * sin(atan(((t * eh) / (0.0 - ew)))))); tmp = 0.0; if (eh <= -5.5e+58) tmp = t_1; elseif (eh <= 5.5e+80) 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[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -5.5e+58], t$95$1, If[LessEqual[eh, 5.5e+80], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{0 - ew}\right)\right|\\
\mathbf{if}\;eh \leq -5.5 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 5.5 \cdot 10^{+80}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -5.4999999999999999e58 or 5.49999999999999967e80 < eh Initial program 99.7%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.7%
Taylor expanded in ew around 0
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
mul-1-negN/A
neg-lowering-neg.f6476.8%
Simplified76.8%
Taylor expanded in t around 0
*-commutativeN/A
*-lowering-*.f6476.9%
Simplified76.9%
if -5.4999999999999999e58 < eh < 5.49999999999999967e80Initial program 99.8%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6479.8%
Simplified79.8%
Final simplification78.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* ew (cos t)))))
(if (<= t -0.00295)
t_1
(if (<= t 0.0005)
(fabs (- ew (* (* t eh) (sin (atan (/ (* t eh) (- 0.0 ew)))))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * cos(t)));
double tmp;
if (t <= -0.00295) {
tmp = t_1;
} else if (t <= 0.0005) {
tmp = fabs((ew - ((t * eh) * sin(atan(((t * eh) / (0.0 - 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 = abs((ew * cos(t)))
if (t <= (-0.00295d0)) then
tmp = t_1
else if (t <= 0.0005d0) then
tmp = abs((ew - ((t * eh) * sin(atan(((t * eh) / (0.0d0 - ew)))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.cos(t)));
double tmp;
if (t <= -0.00295) {
tmp = t_1;
} else if (t <= 0.0005) {
tmp = Math.abs((ew - ((t * eh) * Math.sin(Math.atan(((t * eh) / (0.0 - ew)))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.cos(t))) tmp = 0 if t <= -0.00295: tmp = t_1 elif t <= 0.0005: tmp = math.fabs((ew - ((t * eh) * math.sin(math.atan(((t * eh) / (0.0 - ew))))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * cos(t))) tmp = 0.0 if (t <= -0.00295) tmp = t_1; elseif (t <= 0.0005) tmp = abs(Float64(ew - Float64(Float64(t * eh) * sin(atan(Float64(Float64(t * eh) / Float64(0.0 - ew))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * cos(t))); tmp = 0.0; if (t <= -0.00295) tmp = t_1; elseif (t <= 0.0005) tmp = abs((ew - ((t * eh) * sin(atan(((t * eh) / (0.0 - ew))))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -0.00295], t$95$1, If[LessEqual[t, 0.0005], N[Abs[N[(ew - N[(N[(t * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t * eh), $MachinePrecision] / N[(0.0 - ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;t \leq -0.00295:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 0.0005:\\
\;\;\;\;\left|ew - \left(t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t \cdot eh}{0 - ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -0.00294999999999999993 or 5.0000000000000001e-4 < t Initial program 99.6%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.6%
Taylor expanded in ew around inf
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6452.2%
Simplified52.2%
if -0.00294999999999999993 < t < 5.0000000000000001e-4Initial program 100.0%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in t around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
mul-1-negN/A
neg-lowering-neg.f6498.7%
Simplified98.7%
Taylor expanded in t around 0
*-commutativeN/A
*-lowering-*.f6498.7%
Simplified98.7%
Final simplification75.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (* t eh) ew)) (t_2 (fabs (* ew (cos t)))))
(if (<= t -9.5e-5)
t_2
(if (<= t 0.000125)
(fabs (+ ew (* eh (* t (/ t_1 (hypot 1.0 t_1))))))
t_2))))
double code(double eh, double ew, double t) {
double t_1 = (t * eh) / ew;
double t_2 = fabs((ew * cos(t)));
double tmp;
if (t <= -9.5e-5) {
tmp = t_2;
} else if (t <= 0.000125) {
tmp = fabs((ew + (eh * (t * (t_1 / hypot(1.0, t_1))))));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double eh, double ew, double t) {
double t_1 = (t * eh) / ew;
double t_2 = Math.abs((ew * Math.cos(t)));
double tmp;
if (t <= -9.5e-5) {
tmp = t_2;
} else if (t <= 0.000125) {
tmp = Math.abs((ew + (eh * (t * (t_1 / Math.hypot(1.0, t_1))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = (t * eh) / ew t_2 = math.fabs((ew * math.cos(t))) tmp = 0 if t <= -9.5e-5: tmp = t_2 elif t <= 0.000125: tmp = math.fabs((ew + (eh * (t * (t_1 / math.hypot(1.0, t_1)))))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = Float64(Float64(t * eh) / ew) t_2 = abs(Float64(ew * cos(t))) tmp = 0.0 if (t <= -9.5e-5) tmp = t_2; elseif (t <= 0.000125) tmp = abs(Float64(ew + Float64(eh * Float64(t * Float64(t_1 / hypot(1.0, t_1)))))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = (t * eh) / ew; t_2 = abs((ew * cos(t))); tmp = 0.0; if (t <= -9.5e-5) tmp = t_2; elseif (t <= 0.000125) tmp = abs((ew + (eh * (t * (t_1 / hypot(1.0, t_1)))))); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(t * eh), $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -9.5e-5], t$95$2, If[LessEqual[t, 0.000125], N[Abs[N[(ew + N[(eh * N[(t * N[(t$95$1 / N[Sqrt[1.0 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot eh}{ew}\\
t_2 := \left|ew \cdot \cos t\right|\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-5}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 0.000125:\\
\;\;\;\;\left|ew + eh \cdot \left(t \cdot \frac{t\_1}{\mathsf{hypot}\left(1, t\_1\right)}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -9.5000000000000005e-5 or 1.25e-4 < t Initial program 99.6%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.6%
Taylor expanded in ew around inf
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6452.2%
Simplified52.2%
if -9.5000000000000005e-5 < t < 1.25e-4Initial program 100.0%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in t around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
atan-lowering-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
mul-1-negN/A
neg-lowering-neg.f6498.7%
Simplified98.7%
Taylor expanded in t around 0
*-commutativeN/A
*-lowering-*.f6498.7%
Simplified98.7%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr94.8%
Final simplification73.5%
(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%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.8%
Taylor expanded in ew around inf
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6461.7%
Simplified61.7%
Final simplification61.7%
(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%
cos-atanN/A
/-lowering-/.f64N/A
frac-2negN/A
distribute-frac-neg2N/A
frac-2negN/A
distribute-frac-neg2N/A
sqr-negN/A
hypot-1-defN/A
hypot-lowering-hypot.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.8%
Taylor expanded in t around 0
Simplified42.2%
herbie shell --seed 2024144
(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)))))))