
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(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 / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(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 / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ eh (* ew (tan t)))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh / (ew * tan(t))));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(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 / (ew * tan(t))))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan((eh / (ew * Math.tan(t))));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan((eh / (ew * math.tan(t)))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(eh / Float64(ew * tan(t)))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan((eh / (ew * tan(t)))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
lift-tan.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied egg-rr99.8%
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-atan.f64N/A
lift-cos.f6499.8
lift-/.f64N/A
lift-/.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f6499.8
Applied egg-rr99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (sin t)))
(t_2 (* eh (cos t)))
(t_3 (atan (/ (/ eh ew) (tan t)))))
(if (<= (fabs (+ (* t_2 (sin t_3)) (* t_1 (cos t_3)))) 5e+47)
(fabs
(+
t_1
(*
t_2
(sin
(atan
(/ (fma -0.3333333333333333 (/ (* eh (* t t)) ew) (/ eh ew)) t))))))
(fabs (+ t_1 (* t_2 (sin (atan (/ eh (* ew t))))))))))
double code(double eh, double ew, double t) {
double t_1 = ew * sin(t);
double t_2 = eh * cos(t);
double t_3 = atan(((eh / ew) / tan(t)));
double tmp;
if (fabs(((t_2 * sin(t_3)) + (t_1 * cos(t_3)))) <= 5e+47) {
tmp = fabs((t_1 + (t_2 * sin(atan((fma(-0.3333333333333333, ((eh * (t * t)) / ew), (eh / ew)) / t))))));
} else {
tmp = fabs((t_1 + (t_2 * sin(atan((eh / (ew * t)))))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(ew * sin(t)) t_2 = Float64(eh * cos(t)) t_3 = atan(Float64(Float64(eh / ew) / tan(t))) tmp = 0.0 if (abs(Float64(Float64(t_2 * sin(t_3)) + Float64(t_1 * cos(t_3)))) <= 5e+47) tmp = abs(Float64(t_1 + Float64(t_2 * sin(atan(Float64(fma(-0.3333333333333333, Float64(Float64(eh * Float64(t * t)) / ew), Float64(eh / ew)) / t)))))); else tmp = abs(Float64(t_1 + Float64(t_2 * sin(atan(Float64(eh / Float64(ew * t))))))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[N[(N[(t$95$2 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 5e+47], N[Abs[N[(t$95$1 + N[(t$95$2 * N[Sin[N[ArcTan[N[(N[(-0.3333333333333333 * N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$1 + N[(t$95$2 * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \sin t\\
t_2 := eh \cdot \cos t\\
t_3 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;\left|t\_2 \cdot \sin t\_3 + t\_1 \cdot \cos t\_3\right| \leq 5 \cdot 10^{+47}:\\
\;\;\;\;\left|t\_1 + t\_2 \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \frac{eh \cdot \left(t \cdot t\right)}{ew}, \frac{eh}{ew}\right)}{t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1 + t\_2 \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\
\end{array}
\end{array}
if (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) < 5.00000000000000022e47Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.3
Simplified98.3%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6481.7
Applied egg-rr81.7%
Taylor expanded in eh around 0
Simplified95.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6495.7
Simplified95.7%
if 5.00000000000000022e47 < (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6499.3
Simplified99.3%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6490.0
Applied egg-rr90.0%
Taylor expanded in eh around 0
Simplified99.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6493.3
Simplified93.3%
Final simplification94.3%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* ew (sin t)) (cos (atan (/ eh (* ew t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs((((ew * sin(t)) * cos(atan((eh / (ew * t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(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 * sin(t)) * cos(atan((eh / (ew * t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((ew * Math.sin(t)) * Math.cos(Math.atan((eh / (ew * t))))) + ((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
}
def code(eh, ew, t): return math.fabs((((ew * math.sin(t)) * math.cos(math.atan((eh / (ew * t))))) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(atan(Float64(eh / Float64(ew * t))))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t))))))) end
function tmp = code(eh, ew, t) tmp = abs((((ew * sin(t)) * cos(atan((eh / (ew * t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.9
Simplified98.9%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (sin t)) (* (cos t) (* eh (sin (atan (/ eh (* ew (tan t))))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) + (cos(t) * (eh * sin(atan((eh / (ew * tan(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 * sin(t)) + (cos(t) * (eh * sin(atan((eh / (ew * tan(t)))))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.sin(t)) + (Math.cos(t) * (eh * Math.sin(Math.atan((eh / (ew * Math.tan(t)))))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.sin(t)) + (math.cos(t) * (eh * math.sin(math.atan((eh / (ew * math.tan(t)))))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * sin(t)) + Float64(cos(t) * Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t))))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * sin(t)) + (cos(t) * (eh * sin(atan((eh / (ew * tan(t))))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \sin t + \cos t \cdot \left(eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.9
Simplified98.9%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6486.5
Applied egg-rr86.5%
Taylor expanded in eh around 0
Simplified97.8%
lift-cos.f64N/A
lift-*.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-atan.f64N/A
lift-sin.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied egg-rr97.8%
Final simplification97.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (sin t)))
(t_2 (* eh (cos t)))
(t_3
(fabs
(+
(* t_1 (/ 1.0 (sqrt (fma eh (/ eh (* ew (* ew (* t t)))) 1.0))))
(*
t_2
(sin
(atan
(/ (* (/ eh ew) (fma t (* t -0.3333333333333333) 1.0)) t))))))))
(if (<= eh -2.12e+14)
t_3
(if (<= eh 10.0)
(fabs
(+
t_1
(*
t_2
(sin
(atan
(/
(fma -0.3333333333333333 (/ (* eh (* t t)) ew) (/ eh ew))
t))))))
t_3))))
double code(double eh, double ew, double t) {
double t_1 = ew * sin(t);
double t_2 = eh * cos(t);
double t_3 = fabs(((t_1 * (1.0 / sqrt(fma(eh, (eh / (ew * (ew * (t * t)))), 1.0)))) + (t_2 * sin(atan((((eh / ew) * fma(t, (t * -0.3333333333333333), 1.0)) / t))))));
double tmp;
if (eh <= -2.12e+14) {
tmp = t_3;
} else if (eh <= 10.0) {
tmp = fabs((t_1 + (t_2 * sin(atan((fma(-0.3333333333333333, ((eh * (t * t)) / ew), (eh / ew)) / t))))));
} else {
tmp = t_3;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(ew * sin(t)) t_2 = Float64(eh * cos(t)) t_3 = abs(Float64(Float64(t_1 * Float64(1.0 / sqrt(fma(eh, Float64(eh / Float64(ew * Float64(ew * Float64(t * t)))), 1.0)))) + Float64(t_2 * sin(atan(Float64(Float64(Float64(eh / ew) * fma(t, Float64(t * -0.3333333333333333), 1.0)) / t)))))) tmp = 0.0 if (eh <= -2.12e+14) tmp = t_3; elseif (eh <= 10.0) tmp = abs(Float64(t_1 + Float64(t_2 * sin(atan(Float64(fma(-0.3333333333333333, Float64(Float64(eh * Float64(t * t)) / ew), Float64(eh / ew)) / t)))))); else tmp = t_3; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(N[(t$95$1 * N[(1.0 / N[Sqrt[N[(eh * N[(eh / N[(ew * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[Sin[N[ArcTan[N[(N[(N[(eh / ew), $MachinePrecision] * N[(t * N[(t * -0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.12e+14], t$95$3, If[LessEqual[eh, 10.0], N[Abs[N[(t$95$1 + N[(t$95$2 * N[Sin[N[ArcTan[N[(N[(-0.3333333333333333 * N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \sin t\\
t_2 := eh \cdot \cos t\\
t_3 := \left|t\_1 \cdot \frac{1}{\sqrt{\mathsf{fma}\left(eh, \frac{eh}{ew \cdot \left(ew \cdot \left(t \cdot t\right)\right)}, 1\right)}} + t\_2 \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew} \cdot \mathsf{fma}\left(t, t \cdot -0.3333333333333333, 1\right)}{t}\right)\right|\\
\mathbf{if}\;eh \leq -2.12 \cdot 10^{+14}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eh \leq 10:\\
\;\;\;\;\left|t\_1 + t\_2 \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \frac{eh \cdot \left(t \cdot t\right)}{ew}, \frac{eh}{ew}\right)}{t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if eh < -2.12e14 or 10 < eh Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lower-/.f64N/A
Simplified99.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.9
Simplified98.9%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lift-/.f64N/A
lift-/.f64N/A
times-fracN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-/.f6487.6
lift-+.f64N/A
+-commutativeN/A
Applied egg-rr98.9%
if -2.12e14 < eh < 10Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.6
Simplified98.6%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6485.3
Applied egg-rr85.3%
Taylor expanded in eh around 0
Simplified96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6496.7
Simplified96.7%
Final simplification97.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew t))) (t_2 (* ew (sin t))) (t_3 (* eh (cos t))))
(if (<= t -1.7e+164)
(fabs
(+
t_2
(*
t_3
(sin
(atan
(/ (fma -0.3333333333333333 (/ (* eh (* t t)) ew) (/ eh ew)) t))))))
(fabs
(+
(* t_2 (/ 1.0 (sqrt (+ 1.0 (/ (* eh t_1) (* ew t))))))
(* t_3 (sin (atan t_1))))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
double t_2 = ew * sin(t);
double t_3 = eh * cos(t);
double tmp;
if (t <= -1.7e+164) {
tmp = fabs((t_2 + (t_3 * sin(atan((fma(-0.3333333333333333, ((eh * (t * t)) / ew), (eh / ew)) / t))))));
} else {
tmp = fabs(((t_2 * (1.0 / sqrt((1.0 + ((eh * t_1) / (ew * t)))))) + (t_3 * sin(atan(t_1)))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * t)) t_2 = Float64(ew * sin(t)) t_3 = Float64(eh * cos(t)) tmp = 0.0 if (t <= -1.7e+164) tmp = abs(Float64(t_2 + Float64(t_3 * sin(atan(Float64(fma(-0.3333333333333333, Float64(Float64(eh * Float64(t * t)) / ew), Float64(eh / ew)) / t)))))); else tmp = abs(Float64(Float64(t_2 * Float64(1.0 / sqrt(Float64(1.0 + Float64(Float64(eh * t_1) / Float64(ew * t)))))) + Float64(t_3 * sin(atan(t_1))))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+164], N[Abs[N[(t$95$2 + N[(t$95$3 * N[Sin[N[ArcTan[N[(N[(-0.3333333333333333 * N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(t$95$2 * N[(1.0 / N[Sqrt[N[(1.0 + N[(N[(eh * t$95$1), $MachinePrecision] / N[(ew * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
t_2 := ew \cdot \sin t\\
t_3 := eh \cdot \cos t\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+164}:\\
\;\;\;\;\left|t\_2 + t\_3 \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \frac{eh \cdot \left(t \cdot t\right)}{ew}, \frac{eh}{ew}\right)}{t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_2 \cdot \frac{1}{\sqrt{1 + \frac{eh \cdot t\_1}{ew \cdot t}}} + t\_3 \cdot \sin \tan^{-1} t\_1\right|\\
\end{array}
\end{array}
if t < -1.7000000000000001e164Initial program 99.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6499.6
Simplified99.6%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6485.8
Applied egg-rr85.8%
Taylor expanded in eh around 0
Simplified99.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6492.8
Simplified92.8%
if -1.7000000000000001e164 < t Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.8
Simplified98.8%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6486.6
Applied egg-rr86.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6483.2
Simplified83.2%
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6494.6
Applied egg-rr94.6%
Final simplification94.4%
(FPCore (eh ew t)
:precision binary64
(if (<= eh -4.5e+129)
(fabs
(+
(* (* eh (cos t)) (sin (atan (/ eh (* ew t)))))
(* (* ew t) (/ 1.0 (sqrt (+ 1.0 (/ (* eh eh) (* (* ew t) (* ew t)))))))))
(fabs (+ (* ew (sin t)) (* eh (sin (atan (/ eh (* ew (tan t))))))))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= -4.5e+129) {
tmp = fabs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * t) * (1.0 / sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t)))))))));
} else {
tmp = fabs(((ew * sin(t)) + (eh * sin(atan((eh / (ew * tan(t))))))));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (eh <= (-4.5d+129)) then
tmp = abs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * t) * (1.0d0 / sqrt((1.0d0 + ((eh * eh) / ((ew * t) * (ew * t)))))))))
else
tmp = abs(((ew * sin(t)) + (eh * sin(atan((eh / (ew * tan(t))))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (eh <= -4.5e+129) {
tmp = Math.abs((((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t))))) + ((ew * t) * (1.0 / Math.sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t)))))))));
} else {
tmp = Math.abs(((ew * Math.sin(t)) + (eh * Math.sin(Math.atan((eh / (ew * Math.tan(t))))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if eh <= -4.5e+129: tmp = math.fabs((((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t))))) + ((ew * t) * (1.0 / math.sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t))))))))) else: tmp = math.fabs(((ew * math.sin(t)) + (eh * math.sin(math.atan((eh / (ew * math.tan(t)))))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (eh <= -4.5e+129) tmp = abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t))))) + Float64(Float64(ew * t) * Float64(1.0 / sqrt(Float64(1.0 + Float64(Float64(eh * eh) / Float64(Float64(ew * t) * Float64(ew * t))))))))); else tmp = abs(Float64(Float64(ew * sin(t)) + Float64(eh * sin(atan(Float64(eh / Float64(ew * tan(t)))))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (eh <= -4.5e+129) tmp = abs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * t) * (1.0 / sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t))))))))); else tmp = abs(((ew * sin(t)) + (eh * sin(atan((eh / (ew * tan(t)))))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[eh, -4.5e+129], N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * t), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(1.0 + N[(N[(eh * eh), $MachinePrecision] / N[(N[(ew * t), $MachinePrecision] * N[(ew * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -4.5 \cdot 10^{+129}:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + \left(ew \cdot t\right) \cdot \frac{1}{\sqrt{1 + \frac{eh \cdot eh}{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right|\\
\end{array}
\end{array}
if eh < -4.5000000000000001e129Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6499.8
Simplified99.8%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6488.1
Applied egg-rr88.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6488.1
Simplified88.1%
Taylor expanded in t around 0
lower-*.f6485.4
Simplified85.4%
if -4.5000000000000001e129 < eh Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.7
Simplified98.7%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6486.2
Applied egg-rr86.2%
Taylor expanded in eh around 0
Simplified97.5%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-tan.f6482.3
Simplified82.3%
Final simplification82.7%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* ew (sin t)) (* (* eh (cos t)) (sin (atan (/ eh (* ew t))))))))
double code(double eh, double ew, double t) {
return fabs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan((eh / (ew * 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 * sin(t)) + ((eh * cos(t)) * sin(atan((eh / (ew * t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((ew * Math.sin(t)) + ((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t)))))));
}
def code(eh, ew, t): return math.fabs(((ew * math.sin(t)) + ((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t)))))))
function code(eh, ew, t) return abs(Float64(Float64(ew * sin(t)) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t))))))) end
function tmp = code(eh, ew, t) tmp = abs(((ew * sin(t)) + ((eh * cos(t)) * sin(atan((eh / (ew * t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot \sin t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.9
Simplified98.9%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6486.5
Applied egg-rr86.5%
Taylor expanded in eh around 0
Simplified97.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6490.9
Simplified90.9%
Final simplification90.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ 1.0 (sqrt (+ 1.0 (/ (* eh eh) (* (* ew t) (* ew t)))))))
(t_2 (sin (atan (/ eh (* ew t)))))
(t_3
(fabs
(+ (* (* ew (sin t)) t_1) (* t_2 (fma (* eh (* t t)) -0.5 eh))))))
(if (<= ew -1.9e-7)
t_3
(if (<= ew 9.2e-29)
(fabs (+ (* (* eh (cos t)) t_2) (* (* ew t) t_1)))
t_3))))
double code(double eh, double ew, double t) {
double t_1 = 1.0 / sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t)))));
double t_2 = sin(atan((eh / (ew * t))));
double t_3 = fabs((((ew * sin(t)) * t_1) + (t_2 * fma((eh * (t * t)), -0.5, eh))));
double tmp;
if (ew <= -1.9e-7) {
tmp = t_3;
} else if (ew <= 9.2e-29) {
tmp = fabs((((eh * cos(t)) * t_2) + ((ew * t) * t_1)));
} else {
tmp = t_3;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(1.0 / sqrt(Float64(1.0 + Float64(Float64(eh * eh) / Float64(Float64(ew * t) * Float64(ew * t)))))) t_2 = sin(atan(Float64(eh / Float64(ew * t)))) t_3 = abs(Float64(Float64(Float64(ew * sin(t)) * t_1) + Float64(t_2 * fma(Float64(eh * Float64(t * t)), -0.5, eh)))) tmp = 0.0 if (ew <= -1.9e-7) tmp = t_3; elseif (ew <= 9.2e-29) tmp = abs(Float64(Float64(Float64(eh * cos(t)) * t_2) + Float64(Float64(ew * t) * t_1))); else tmp = t_3; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(1.0 / N[Sqrt[N[(1.0 + N[(N[(eh * eh), $MachinePrecision] / N[(N[(ew * t), $MachinePrecision] * N[(ew * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(eh * N[(t * t), $MachinePrecision]), $MachinePrecision] * -0.5 + eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.9e-7], t$95$3, If[LessEqual[ew, 9.2e-29], N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(N[(ew * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{1 + \frac{eh \cdot eh}{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}}}\\
t_2 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\\
t_3 := \left|\left(ew \cdot \sin t\right) \cdot t\_1 + t\_2 \cdot \mathsf{fma}\left(eh \cdot \left(t \cdot t\right), -0.5, eh\right)\right|\\
\mathbf{if}\;ew \leq -1.9 \cdot 10^{-7}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;ew \leq 9.2 \cdot 10^{-29}:\\
\;\;\;\;\left|\left(eh \cdot \cos t\right) \cdot t\_2 + \left(ew \cdot t\right) \cdot t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if ew < -1.90000000000000007e-7 or 9.19999999999999965e-29 < ew Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6499.3
Simplified99.3%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6488.2
Applied egg-rr88.2%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6485.9
Simplified85.9%
Taylor expanded in t around 0
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.6
Simplified65.6%
if -1.90000000000000007e-7 < ew < 9.19999999999999965e-29Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.3
Simplified98.3%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6484.3
Applied egg-rr84.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6476.6
Simplified76.6%
Taylor expanded in t around 0
lower-*.f6470.1
Simplified70.1%
Final simplification67.6%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ eh (* ew t))))) (* (* ew t) (/ 1.0 (sqrt (+ 1.0 (/ (* eh eh) (* (* ew t) (* ew t))))))))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * t) * (1.0 / sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t)))))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * t) * (1.0d0 / sqrt((1.0d0 + ((eh * eh) / ((ew * t) * (ew * t)))))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (ew * t))))) + ((ew * t) * (1.0 / Math.sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t)))))))));
}
def code(eh, ew, t): return math.fabs((((eh * math.cos(t)) * math.sin(math.atan((eh / (ew * t))))) + ((ew * t) * (1.0 / math.sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t)))))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(ew * t))))) + Float64(Float64(ew * t) * Float64(1.0 / sqrt(Float64(1.0 + Float64(Float64(eh * eh) / Float64(Float64(ew * t) * Float64(ew * t))))))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan((eh / (ew * t))))) + ((ew * t) * (1.0 / sqrt((1.0 + ((eh * eh) / ((ew * t) * (ew * t))))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * t), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(1.0 + N[(N[(eh * eh), $MachinePrecision] / N[(N[(ew * t), $MachinePrecision] * N[(ew * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + \left(ew \cdot t\right) \cdot \frac{1}{\sqrt{1 + \frac{eh \cdot eh}{\left(ew \cdot t\right) \cdot \left(ew \cdot t\right)}}}\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.9
Simplified98.9%
lift-*.f64N/A
lift-/.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-negN/A
lower-/.f64N/A
lower-*.f64N/A
sqr-negN/A
lower-*.f6486.5
Applied egg-rr86.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6481.8
Simplified81.8%
Taylor expanded in t around 0
lower-*.f6461.8
Simplified61.8%
Final simplification61.8%
herbie shell --seed 2024215
(FPCore (eh ew t)
:name "Example from Robby"
:precision binary64
(fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))