
(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 21 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 (- (* (* eh (sin t)) (sin (atan (/ (* eh (tan t)) (- ew))))) (* (* (cos t) ew) (cos (atan (* (/ (tan t) ew) eh)))))))
double code(double eh, double ew, double t) {
return fabs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) * cos(atan(((tan(t) / ew) * eh))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) * cos(atan(((tan(t) / ew) * eh))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.sin(t)) * Math.sin(Math.atan(((eh * Math.tan(t)) / -ew)))) - ((Math.cos(t) * ew) * Math.cos(Math.atan(((Math.tan(t) / ew) * eh))))));
}
def code(eh, ew, t): return math.fabs((((eh * math.sin(t)) * math.sin(math.atan(((eh * math.tan(t)) / -ew)))) - ((math.cos(t) * ew) * math.cos(math.atan(((math.tan(t) / ew) * eh))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))) - Float64(Float64(cos(t) * ew) * cos(atan(Float64(Float64(tan(t) / ew) * eh)))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * sin(t)) * sin(atan(((eh * tan(t)) / -ew)))) - ((cos(t) * ew) * cos(atan(((tan(t) / ew) * eh)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right) - \left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right|
\end{array}
Initial program 99.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
lift-cos.f64N/A
cos-neg-revN/A
lower-cos.f64N/A
lift-atan.f64N/A
atan-neg-revN/A
lower-atan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* eh (sin t)))
(t_2 (* ew (cos t)))
(t_3 (/ (tan t) ew))
(t_4 (atan (/ (* eh (tan t)) (- ew))))
(t_5 (- (* t_2 (cos t_4)) (* t_1 (sin t_4)))))
(if (or (<= t_5 2e-245) (not (<= t_5 1e-9)))
(fabs
(-
(* t_1 (sin (atan (/ (* (- t) eh) ew))))
(* t_2 (cos (atan (/ (* (- eh) t) ew))))))
(/ (fma (* eh t_3) (* (sin t) eh) t_2) (cosh (asinh (* t_3 eh)))))))
double code(double eh, double ew, double t) {
double t_1 = eh * sin(t);
double t_2 = ew * cos(t);
double t_3 = tan(t) / ew;
double t_4 = atan(((eh * tan(t)) / -ew));
double t_5 = (t_2 * cos(t_4)) - (t_1 * sin(t_4));
double tmp;
if ((t_5 <= 2e-245) || !(t_5 <= 1e-9)) {
tmp = fabs(((t_1 * sin(atan(((-t * eh) / ew)))) - (t_2 * cos(atan(((-eh * t) / ew))))));
} else {
tmp = fma((eh * t_3), (sin(t) * eh), t_2) / cosh(asinh((t_3 * eh)));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(eh * sin(t)) t_2 = Float64(ew * cos(t)) t_3 = Float64(tan(t) / ew) t_4 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew))) t_5 = Float64(Float64(t_2 * cos(t_4)) - Float64(t_1 * sin(t_4))) tmp = 0.0 if ((t_5 <= 2e-245) || !(t_5 <= 1e-9)) tmp = abs(Float64(Float64(t_1 * sin(atan(Float64(Float64(Float64(-t) * eh) / ew)))) - Float64(t_2 * cos(atan(Float64(Float64(Float64(-eh) * t) / ew)))))); else tmp = Float64(fma(Float64(eh * t_3), Float64(sin(t) * eh), t_2) / cosh(asinh(Float64(t_3 * eh)))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$2 * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$5, 2e-245], N[Not[LessEqual[t$95$5, 1e-9]], $MachinePrecision]], N[Abs[N[(N[(t$95$1 * N[Sin[N[ArcTan[N[(N[((-t) * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * N[Cos[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(eh * t$95$3), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] + t$95$2), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(t$95$3 * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \sin t\\
t_2 := ew \cdot \cos t\\
t_3 := \frac{\tan t}{ew}\\
t_4 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
t_5 := t\_2 \cdot \cos t\_4 - t\_1 \cdot \sin t\_4\\
\mathbf{if}\;t\_5 \leq 2 \cdot 10^{-245} \lor \neg \left(t\_5 \leq 10^{-9}\right):\\
\;\;\;\;\left|t\_1 \cdot \sin \tan^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right) - t\_2 \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(eh \cdot t\_3, \sin t \cdot eh, t\_2\right)}{\cosh \sinh^{-1} \left(t\_3 \cdot eh\right)}\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < 1.9999999999999999e-245 or 1.00000000000000006e-9 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.4
Applied rewrites99.4%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6493.4
Applied rewrites93.4%
if 1.9999999999999999e-245 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < 1.00000000000000006e-9Initial program 99.8%
Applied rewrites90.5%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f6497.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6497.6
lift-*.f64N/A
*-commutativeN/A
lift-*.f6497.6
Applied rewrites97.6%
Final simplification94.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (* eh (tan t)) (- ew))))
(t_2 (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))))
(if (<= t_2 -1e+151)
(* (sin (+ (- t) (PI))) eh)
(if (<= t_2 -4e-278) (* (sin t) eh) (* (cos t) ew)))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
t_2 := \left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;\sin \left(\left(-t\right) + \mathsf{PI}\left(\right)\right) \cdot eh\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-278}:\\
\;\;\;\;\sin t \cdot eh\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -1.00000000000000002e151Initial program 99.9%
Applied rewrites0.2%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites1.7%
Taylor expanded in eh around inf
Applied rewrites7.7%
Applied rewrites29.0%
if -1.00000000000000002e151 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -3.99999999999999975e-278Initial program 99.8%
Applied rewrites1.9%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites16.3%
Taylor expanded in eh around inf
Applied rewrites21.2%
if -3.99999999999999975e-278 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Applied rewrites65.7%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6463.7
Applied rewrites63.7%
Final simplification44.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (* eh (tan t)) (- ew))))
(t_2 (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))))
(if (<= t_2 -1e+151)
(* (sin (+ (PI) t)) (- eh))
(if (<= t_2 -4e-278) (* (sin t) eh) (* (cos t) ew)))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
t_2 := \left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;\sin \left(\mathsf{PI}\left(\right) + t\right) \cdot \left(-eh\right)\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-278}:\\
\;\;\;\;\sin t \cdot eh\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -1.00000000000000002e151Initial program 99.9%
Applied rewrites0.2%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites1.7%
Taylor expanded in eh around inf
Applied rewrites7.7%
Applied rewrites29.0%
if -1.00000000000000002e151 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -3.99999999999999975e-278Initial program 99.8%
Applied rewrites1.9%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites16.3%
Taylor expanded in eh around inf
Applied rewrites21.2%
if -3.99999999999999975e-278 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Applied rewrites65.7%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6463.7
Applied rewrites63.7%
Final simplification44.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sqrt (PI))) (t_2 (atan (/ (* eh (tan t)) (- ew)))))
(if (<=
(- (* (* ew (cos t)) (cos t_2)) (* (* eh (sin t)) (sin t_2)))
-4e-278)
(fabs (* (sin (fma t_1 (/ t_1 2.0) (atan (* (/ (tan t) ew) eh)))) ew))
(* (cos t) ew))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\mathsf{PI}\left(\right)}\\
t_2 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq -4 \cdot 10^{-278}:\\
\;\;\;\;\left|\sin \left(\mathsf{fma}\left(t\_1, \frac{t\_1}{2}, \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right) \cdot ew\right|\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -3.99999999999999975e-278Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites50.1%
Applied rewrites49.9%
Applied rewrites50.1%
if -3.99999999999999975e-278 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Applied rewrites65.7%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6463.7
Applied rewrites63.7%
Final simplification57.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (* eh (tan t)) (- ew)))))
(if (<=
(- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))
-4e-278)
(fabs (* (cos (atan (* eh (/ (tan t) ew)))) ew))
(* (cos t) ew))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh * tan(t)) / -ew));
double tmp;
if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -4e-278) {
tmp = fabs((cos(atan((eh * (tan(t) / ew)))) * ew));
} else {
tmp = cos(t) * ew;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = atan(((eh * tan(t)) / -ew))
if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= (-4d-278)) then
tmp = abs((cos(atan((eh * (tan(t) / ew)))) * ew))
else
tmp = cos(t) * ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh * Math.tan(t)) / -ew));
double tmp;
if ((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))) <= -4e-278) {
tmp = Math.abs((Math.cos(Math.atan((eh * (Math.tan(t) / ew)))) * ew));
} else {
tmp = Math.cos(t) * ew;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan(((eh * math.tan(t)) / -ew)) tmp = 0 if (((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))) <= -4e-278: tmp = math.fabs((math.cos(math.atan((eh * (math.tan(t) / ew)))) * ew)) else: tmp = math.cos(t) * ew return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew))) tmp = 0.0 if (Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))) <= -4e-278) tmp = abs(Float64(cos(atan(Float64(eh * Float64(tan(t) / ew)))) * ew)); else tmp = Float64(cos(t) * ew); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan(((eh * tan(t)) / -ew)); tmp = 0.0; if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -4e-278) tmp = abs((cos(atan((eh * (tan(t) / ew)))) * ew)); else tmp = cos(t) * ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[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], -4e-278], N[Abs[N[(N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-278}:\\
\;\;\;\;\left|\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right) \cdot ew\right|\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -3.99999999999999975e-278Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites50.1%
Applied rewrites50.1%
if -3.99999999999999975e-278 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Applied rewrites65.7%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6463.7
Applied rewrites63.7%
Final simplification57.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (* eh (tan t)) (- ew)))))
(if (<=
(- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))
-4e-278)
(fabs (* (sin (+ (/ (PI) 2.0) (atan (/ (* eh t) ew)))) ew))
(* (cos t) ew))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-278}:\\
\;\;\;\;\left|\sin \left(\frac{\mathsf{PI}\left(\right)}{2} + \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right) \cdot ew\right|\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -3.99999999999999975e-278Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites50.1%
Applied rewrites49.9%
Taylor expanded in t around 0
Applied rewrites48.6%
if -3.99999999999999975e-278 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Applied rewrites65.7%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6463.7
Applied rewrites63.7%
Final simplification56.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (* eh (tan t)) (- ew)))))
(if (<=
(- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1)))
-4e-278)
(* (sin t) eh)
(* (cos t) ew))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh * tan(t)) / -ew));
double tmp;
if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -4e-278) {
tmp = sin(t) * eh;
} else {
tmp = cos(t) * ew;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = atan(((eh * tan(t)) / -ew))
if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= (-4d-278)) then
tmp = sin(t) * eh
else
tmp = cos(t) * ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh * Math.tan(t)) / -ew));
double tmp;
if ((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))) <= -4e-278) {
tmp = Math.sin(t) * eh;
} else {
tmp = Math.cos(t) * ew;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan(((eh * math.tan(t)) / -ew)) tmp = 0 if (((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))) <= -4e-278: tmp = math.sin(t) * eh else: tmp = math.cos(t) * ew return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh * tan(t)) / Float64(-ew))) tmp = 0.0 if (Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))) <= -4e-278) tmp = Float64(sin(t) * eh); else tmp = Float64(cos(t) * ew); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan(((eh * tan(t)) / -ew)); tmp = 0.0; if ((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))) <= -4e-278) tmp = sin(t) * eh; else tmp = cos(t) * ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[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], -4e-278], N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\\
\mathbf{if}\;\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1 \leq -4 \cdot 10^{-278}:\\
\;\;\;\;\sin t \cdot eh\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot ew\\
\end{array}
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -3.99999999999999975e-278Initial program 99.9%
Applied rewrites1.2%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites10.6%
Taylor expanded in eh around inf
Applied rewrites15.9%
if -3.99999999999999975e-278 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Applied rewrites65.7%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6463.7
Applied rewrites63.7%
Final simplification40.9%
(FPCore (eh ew t) :precision binary64 (fabs (- (* (* eh (sin t)) (sin (atan (/ (* (- t) eh) ew)))) (* (* ew (cos t)) (cos (atan (/ (* eh (tan t)) (- ew))))))))
double code(double eh, double ew, double t) {
return fabs((((eh * sin(t)) * sin(atan(((-t * eh) / ew)))) - ((ew * cos(t)) * cos(atan(((eh * tan(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((((eh * sin(t)) * sin(atan(((-t * eh) / ew)))) - ((ew * cos(t)) * cos(atan(((eh * tan(t)) / -ew))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.sin(t)) * Math.sin(Math.atan(((-t * eh) / ew)))) - ((ew * Math.cos(t)) * Math.cos(Math.atan(((eh * Math.tan(t)) / -ew))))));
}
def code(eh, ew, t): return math.fabs((((eh * math.sin(t)) * math.sin(math.atan(((-t * eh) / ew)))) - ((ew * math.cos(t)) * math.cos(math.atan(((eh * math.tan(t)) / -ew))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-t) * eh) / ew)))) - Float64(Float64(ew * cos(t)) * cos(atan(Float64(Float64(eh * tan(t)) / Float64(-ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * sin(t)) * sin(atan(((-t * eh) / ew)))) - ((ew * cos(t)) * cos(atan(((eh * tan(t)) / -ew)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-t) * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right) - \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{-ew}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
Applied rewrites99.2%
Final simplification99.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (tan t) ew)))
(if (or (<= eh -4.3e+77) (not (<= eh 2.6e+77)))
(fabs
(-
(* (* eh (sin t)) (sin (atan (/ (* (- t) eh) ew))))
(* (* ew (cos t)) (cos (atan (/ (* (- eh) t) ew))))))
(fabs
(/
(fma (sin t) (* t_1 (* eh eh)) (* (cos t) ew))
(cosh (asinh (* t_1 eh))))))))
double code(double eh, double ew, double t) {
double t_1 = tan(t) / ew;
double tmp;
if ((eh <= -4.3e+77) || !(eh <= 2.6e+77)) {
tmp = fabs((((eh * sin(t)) * sin(atan(((-t * eh) / ew)))) - ((ew * cos(t)) * cos(atan(((-eh * t) / ew))))));
} else {
tmp = fabs((fma(sin(t), (t_1 * (eh * eh)), (cos(t) * ew)) / cosh(asinh((t_1 * eh)))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(tan(t) / ew) tmp = 0.0 if ((eh <= -4.3e+77) || !(eh <= 2.6e+77)) tmp = abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-t) * eh) / ew)))) - Float64(Float64(ew * cos(t)) * cos(atan(Float64(Float64(Float64(-eh) * t) / ew)))))); else tmp = abs(Float64(fma(sin(t), Float64(t_1 * Float64(eh * eh)), Float64(cos(t) * ew)) / cosh(asinh(Float64(t_1 * eh))))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, If[Or[LessEqual[eh, -4.3e+77], N[Not[LessEqual[eh, 2.6e+77]], $MachinePrecision]], N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-t) * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(t$95$1 * N[(eh * eh), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(t$95$1 * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\tan t}{ew}\\
\mathbf{if}\;eh \leq -4.3 \cdot 10^{+77} \lor \neg \left(eh \leq 2.6 \cdot 10^{+77}\right):\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right) - \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, t\_1 \cdot \left(eh \cdot eh\right), \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(t\_1 \cdot eh\right)}\right|\\
\end{array}
\end{array}
if eh < -4.29999999999999991e77 or 2.6000000000000002e77 < eh Initial program 99.9%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.5
Applied rewrites99.5%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6495.2
Applied rewrites95.2%
if -4.29999999999999991e77 < eh < 2.6000000000000002e77Initial program 99.8%
Applied rewrites95.6%
Final simplification95.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(*
(* (- (sin t)) eh)
(sin
(atan
(*
(fma (* 0.3333333333333333 (/ eh ew)) (* t t) (/ eh ew))
(- t)))))))
(t_2 (* (cos t) ew))
(t_3 (fabs (* t_2 (cos (atan (/ (* (- eh) (sin t)) t_2)))))))
(if (<= t -1.35e+165)
t_1
(if (<= t -60000.0)
t_3
(if (<= t 1.15e+35)
(fabs
(-
(* (* eh (sin t)) (sin (atan (/ (* (- t) eh) ew))))
(*
(fma
(fma 0.041666666666666664 (* (* t t) ew) (* -0.5 ew))
(* t t)
ew)
(cos (atan (/ (* (- eh) t) ew))))))
(if (<= t 1.75e+136) t_3 t_1))))))
double code(double eh, double ew, double t) {
double t_1 = fabs(((-sin(t) * eh) * sin(atan((fma((0.3333333333333333 * (eh / ew)), (t * t), (eh / ew)) * -t)))));
double t_2 = cos(t) * ew;
double t_3 = fabs((t_2 * cos(atan(((-eh * sin(t)) / t_2)))));
double tmp;
if (t <= -1.35e+165) {
tmp = t_1;
} else if (t <= -60000.0) {
tmp = t_3;
} else if (t <= 1.15e+35) {
tmp = fabs((((eh * sin(t)) * sin(atan(((-t * eh) / ew)))) - (fma(fma(0.041666666666666664, ((t * t) * ew), (-0.5 * ew)), (t * t), ew) * cos(atan(((-eh * t) / ew))))));
} else if (t <= 1.75e+136) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(Float64(Float64(Float64(-sin(t)) * eh) * sin(atan(Float64(fma(Float64(0.3333333333333333 * Float64(eh / ew)), Float64(t * t), Float64(eh / ew)) * Float64(-t)))))) t_2 = Float64(cos(t) * ew) t_3 = abs(Float64(t_2 * cos(atan(Float64(Float64(Float64(-eh) * sin(t)) / t_2))))) tmp = 0.0 if (t <= -1.35e+165) tmp = t_1; elseif (t <= -60000.0) tmp = t_3; elseif (t <= 1.15e+35) tmp = abs(Float64(Float64(Float64(eh * sin(t)) * sin(atan(Float64(Float64(Float64(-t) * eh) / ew)))) - Float64(fma(fma(0.041666666666666664, Float64(Float64(t * t) * ew), Float64(-0.5 * ew)), Float64(t * t), ew) * cos(atan(Float64(Float64(Float64(-eh) * t) / ew)))))); elseif (t <= 1.75e+136) tmp = t_3; else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[(0.3333333333333333 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] * (-t)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(t$95$2 * N[Cos[N[ArcTan[N[(N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.35e+165], t$95$1, If[LessEqual[t, -60000.0], t$95$3, If[LessEqual[t, 1.15e+35], N[Abs[N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-t) * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.041666666666666664 * N[(N[(t * t), $MachinePrecision] * ew), $MachinePrecision] + N[(-0.5 * ew), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 1.75e+136], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{fma}\left(0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{eh}{ew}\right) \cdot \left(-t\right)\right)\right|\\
t_2 := \cos t \cdot ew\\
t_3 := \left|t\_2 \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{t\_2}\right)\right|\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -60000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;\left|\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-t\right) \cdot eh}{ew}\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.041666666666666664, \left(t \cdot t\right) \cdot ew, -0.5 \cdot ew\right), t \cdot t, ew\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right)\right|\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+136}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.35e165 or 1.75000000000000001e136 < t Initial program 99.6%
Taylor expanded in eh around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
*-commutativeN/A
times-fracN/A
distribute-lft-neg-inN/A
Applied rewrites66.6%
Taylor expanded in t around 0
Applied rewrites66.8%
if -1.35e165 < t < -6e4 or 1.1499999999999999e35 < t < 1.75000000000000001e136Initial program 99.7%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6498.8
Applied rewrites98.8%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6474.3
Applied rewrites74.3%
Taylor expanded in eh around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-cos.f64N/A
lower-atan.f64N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6472.1
Applied rewrites72.1%
if -6e4 < t < 1.1499999999999999e35Initial program 100.0%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6498.7
Applied rewrites98.7%
Final simplification86.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (- (sin t))) (t_2 (/ (tan t) ew)))
(if (<= eh -7e+117)
(fabs (* (* (tanh (asinh (* t_2 (- eh)))) t_1) eh))
(if (<= eh 2.4e+99)
(fabs
(/
(fma (sin t) (/ (* (* eh eh) t) ew) (* (cos t) ew))
(cosh (asinh (* t_2 eh)))))
(fabs (* (* t_1 eh) (sin (atan (* (/ t_1 ew) (/ eh (cos t)))))))))))
double code(double eh, double ew, double t) {
double t_1 = -sin(t);
double t_2 = tan(t) / ew;
double tmp;
if (eh <= -7e+117) {
tmp = fabs(((tanh(asinh((t_2 * -eh))) * t_1) * eh));
} else if (eh <= 2.4e+99) {
tmp = fabs((fma(sin(t), (((eh * eh) * t) / ew), (cos(t) * ew)) / cosh(asinh((t_2 * eh)))));
} else {
tmp = fabs(((t_1 * eh) * sin(atan(((t_1 / ew) * (eh / cos(t)))))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(-sin(t)) t_2 = Float64(tan(t) / ew) tmp = 0.0 if (eh <= -7e+117) tmp = abs(Float64(Float64(tanh(asinh(Float64(t_2 * Float64(-eh)))) * t_1) * eh)); elseif (eh <= 2.4e+99) tmp = abs(Float64(fma(sin(t), Float64(Float64(Float64(eh * eh) * t) / ew), Float64(cos(t) * ew)) / cosh(asinh(Float64(t_2 * eh))))); else tmp = abs(Float64(Float64(t_1 * eh) * sin(atan(Float64(Float64(t_1 / ew) * Float64(eh / cos(t))))))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = (-N[Sin[t], $MachinePrecision])}, Block[{t$95$2 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, If[LessEqual[eh, -7e+117], N[Abs[N[(N[(N[Tanh[N[ArcSinh[N[(t$95$2 * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 2.4e+99], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * N[(N[(N[(eh * eh), $MachinePrecision] * t), $MachinePrecision] / ew), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(t$95$2 * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(t$95$1 * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] * N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\sin t\\
t_2 := \frac{\tan t}{ew}\\
\mathbf{if}\;eh \leq -7 \cdot 10^{+117}:\\
\;\;\;\;\left|\left(\tanh \sinh^{-1} \left(t\_2 \cdot \left(-eh\right)\right) \cdot t\_1\right) \cdot eh\right|\\
\mathbf{elif}\;eh \leq 2.4 \cdot 10^{+99}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\sin t, \frac{\left(eh \cdot eh\right) \cdot t}{ew}, \cos t \cdot ew\right)}{\cosh \sinh^{-1} \left(t\_2 \cdot eh\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(t\_1 \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t\_1}{ew} \cdot \frac{eh}{\cos t}\right)\right|\\
\end{array}
\end{array}
if eh < -6.99999999999999965e117Initial program 99.8%
Taylor expanded in eh around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
*-commutativeN/A
times-fracN/A
distribute-lft-neg-inN/A
Applied rewrites78.1%
Applied rewrites78.1%
if -6.99999999999999965e117 < eh < 2.4000000000000001e99Initial program 99.8%
Applied rewrites95.2%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6484.1
Applied rewrites84.1%
if 2.4000000000000001e99 < eh Initial program 99.9%
Taylor expanded in eh around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
*-commutativeN/A
times-fracN/A
distribute-lft-neg-inN/A
Applied rewrites67.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (cos t)))
(t_2 (* (cos t) ew))
(t_3 (- (sin t)))
(t_4 (/ t_3 ew)))
(if (<= ew -4.3e-95)
(fabs (* t_2 (cos (atan (/ (* (- eh) (sin t)) t_2)))))
(if (<= ew 1.05e-140)
(fabs (* (* t_3 eh) (sin (atan (* t_4 t_1)))))
(fabs (* (* (cos (atan (* t_1 t_4))) (cos t)) ew))))))
double code(double eh, double ew, double t) {
double t_1 = eh / cos(t);
double t_2 = cos(t) * ew;
double t_3 = -sin(t);
double t_4 = t_3 / ew;
double tmp;
if (ew <= -4.3e-95) {
tmp = fabs((t_2 * cos(atan(((-eh * sin(t)) / t_2)))));
} else if (ew <= 1.05e-140) {
tmp = fabs(((t_3 * eh) * sin(atan((t_4 * t_1)))));
} else {
tmp = fabs(((cos(atan((t_1 * t_4))) * cos(t)) * ew));
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = eh / cos(t)
t_2 = cos(t) * ew
t_3 = -sin(t)
t_4 = t_3 / ew
if (ew <= (-4.3d-95)) then
tmp = abs((t_2 * cos(atan(((-eh * sin(t)) / t_2)))))
else if (ew <= 1.05d-140) then
tmp = abs(((t_3 * eh) * sin(atan((t_4 * t_1)))))
else
tmp = abs(((cos(atan((t_1 * t_4))) * cos(t)) * ew))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = eh / Math.cos(t);
double t_2 = Math.cos(t) * ew;
double t_3 = -Math.sin(t);
double t_4 = t_3 / ew;
double tmp;
if (ew <= -4.3e-95) {
tmp = Math.abs((t_2 * Math.cos(Math.atan(((-eh * Math.sin(t)) / t_2)))));
} else if (ew <= 1.05e-140) {
tmp = Math.abs(((t_3 * eh) * Math.sin(Math.atan((t_4 * t_1)))));
} else {
tmp = Math.abs(((Math.cos(Math.atan((t_1 * t_4))) * Math.cos(t)) * ew));
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / math.cos(t) t_2 = math.cos(t) * ew t_3 = -math.sin(t) t_4 = t_3 / ew tmp = 0 if ew <= -4.3e-95: tmp = math.fabs((t_2 * math.cos(math.atan(((-eh * math.sin(t)) / t_2))))) elif ew <= 1.05e-140: tmp = math.fabs(((t_3 * eh) * math.sin(math.atan((t_4 * t_1))))) else: tmp = math.fabs(((math.cos(math.atan((t_1 * t_4))) * math.cos(t)) * ew)) return tmp
function code(eh, ew, t) t_1 = Float64(eh / cos(t)) t_2 = Float64(cos(t) * ew) t_3 = Float64(-sin(t)) t_4 = Float64(t_3 / ew) tmp = 0.0 if (ew <= -4.3e-95) tmp = abs(Float64(t_2 * cos(atan(Float64(Float64(Float64(-eh) * sin(t)) / t_2))))); elseif (ew <= 1.05e-140) tmp = abs(Float64(Float64(t_3 * eh) * sin(atan(Float64(t_4 * t_1))))); else tmp = abs(Float64(Float64(cos(atan(Float64(t_1 * t_4))) * cos(t)) * ew)); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / cos(t); t_2 = cos(t) * ew; t_3 = -sin(t); t_4 = t_3 / ew; tmp = 0.0; if (ew <= -4.3e-95) tmp = abs((t_2 * cos(atan(((-eh * sin(t)) / t_2))))); elseif (ew <= 1.05e-140) tmp = abs(((t_3 * eh) * sin(atan((t_4 * t_1))))); else tmp = abs(((cos(atan((t_1 * t_4))) * cos(t)) * ew)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = (-N[Sin[t], $MachinePrecision])}, Block[{t$95$4 = N[(t$95$3 / ew), $MachinePrecision]}, If[LessEqual[ew, -4.3e-95], N[Abs[N[(t$95$2 * N[Cos[N[ArcTan[N[(N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.05e-140], N[Abs[N[(N[(t$95$3 * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(t$95$4 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Cos[N[ArcTan[N[(t$95$1 * t$95$4), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{\cos t}\\
t_2 := \cos t \cdot ew\\
t_3 := -\sin t\\
t_4 := \frac{t\_3}{ew}\\
\mathbf{if}\;ew \leq -4.3 \cdot 10^{-95}:\\
\;\;\;\;\left|t\_2 \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{t\_2}\right)\right|\\
\mathbf{elif}\;ew \leq 1.05 \cdot 10^{-140}:\\
\;\;\;\;\left|\left(t\_3 \cdot eh\right) \cdot \sin \tan^{-1} \left(t\_4 \cdot t\_1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\cos \tan^{-1} \left(t\_1 \cdot t\_4\right) \cdot \cos t\right) \cdot ew\right|\\
\end{array}
\end{array}
if ew < -4.29999999999999997e-95Initial program 99.9%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.6
Applied rewrites99.6%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6489.9
Applied rewrites89.9%
Taylor expanded in eh around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-cos.f64N/A
lower-atan.f64N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6480.3
Applied rewrites80.3%
if -4.29999999999999997e-95 < ew < 1.05000000000000009e-140Initial program 99.8%
Taylor expanded in eh around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
*-commutativeN/A
times-fracN/A
distribute-lft-neg-inN/A
Applied rewrites73.8%
if 1.05000000000000009e-140 < ew Initial program 99.9%
Taylor expanded in ew around inf
Applied rewrites96.5%
Taylor expanded in eh around 0
Applied rewrites78.9%
Final simplification77.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) ew)) (t_2 (- (sin t))))
(if (<= ew -4.3e-95)
(fabs (* t_1 (cos (atan (/ (* (- eh) (sin t)) t_1)))))
(if (<= ew 1.05e-140)
(fabs (* (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) t_2) eh))
(fabs (* (* (cos (atan (* (/ eh (cos t)) (/ t_2 ew)))) (cos t)) ew))))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * ew;
double t_2 = -sin(t);
double tmp;
if (ew <= -4.3e-95) {
tmp = fabs((t_1 * cos(atan(((-eh * sin(t)) / t_1)))));
} else if (ew <= 1.05e-140) {
tmp = fabs(((tanh(asinh(((tan(t) / ew) * -eh))) * t_2) * eh));
} else {
tmp = fabs(((cos(atan(((eh / cos(t)) * (t_2 / ew)))) * cos(t)) * ew));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.cos(t) * ew t_2 = -math.sin(t) tmp = 0 if ew <= -4.3e-95: tmp = math.fabs((t_1 * math.cos(math.atan(((-eh * math.sin(t)) / t_1))))) elif ew <= 1.05e-140: tmp = math.fabs(((math.tanh(math.asinh(((math.tan(t) / ew) * -eh))) * t_2) * eh)) else: tmp = math.fabs(((math.cos(math.atan(((eh / math.cos(t)) * (t_2 / ew)))) * math.cos(t)) * ew)) return tmp
function code(eh, ew, t) t_1 = Float64(cos(t) * ew) t_2 = Float64(-sin(t)) tmp = 0.0 if (ew <= -4.3e-95) tmp = abs(Float64(t_1 * cos(atan(Float64(Float64(Float64(-eh) * sin(t)) / t_1))))); elseif (ew <= 1.05e-140) tmp = abs(Float64(Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * t_2) * eh)); else tmp = abs(Float64(Float64(cos(atan(Float64(Float64(eh / cos(t)) * Float64(t_2 / ew)))) * cos(t)) * ew)); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = cos(t) * ew; t_2 = -sin(t); tmp = 0.0; if (ew <= -4.3e-95) tmp = abs((t_1 * cos(atan(((-eh * sin(t)) / t_1))))); elseif (ew <= 1.05e-140) tmp = abs(((tanh(asinh(((tan(t) / ew) * -eh))) * t_2) * eh)); else tmp = abs(((cos(atan(((eh / cos(t)) * (t_2 / ew)))) * cos(t)) * ew)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = (-N[Sin[t], $MachinePrecision])}, If[LessEqual[ew, -4.3e-95], N[Abs[N[(t$95$1 * N[Cos[N[ArcTan[N[(N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.05e-140], N[Abs[N[(N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Cos[N[ArcTan[N[(N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot ew\\
t_2 := -\sin t\\
\mathbf{if}\;ew \leq -4.3 \cdot 10^{-95}:\\
\;\;\;\;\left|t\_1 \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{t\_1}\right)\right|\\
\mathbf{elif}\;ew \leq 1.05 \cdot 10^{-140}:\\
\;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot t\_2\right) \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\cos \tan^{-1} \left(\frac{eh}{\cos t} \cdot \frac{t\_2}{ew}\right) \cdot \cos t\right) \cdot ew\right|\\
\end{array}
\end{array}
if ew < -4.29999999999999997e-95Initial program 99.9%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.6
Applied rewrites99.6%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6489.9
Applied rewrites89.9%
Taylor expanded in eh around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-cos.f64N/A
lower-atan.f64N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6480.3
Applied rewrites80.3%
if -4.29999999999999997e-95 < ew < 1.05000000000000009e-140Initial program 99.8%
Taylor expanded in eh around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
*-commutativeN/A
times-fracN/A
distribute-lft-neg-inN/A
Applied rewrites73.8%
Applied rewrites73.8%
if 1.05000000000000009e-140 < ew Initial program 99.9%
Taylor expanded in ew around inf
Applied rewrites96.5%
Taylor expanded in eh around 0
Applied rewrites78.9%
Final simplification77.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) ew)))
(if (or (<= ew -4.3e-95) (not (<= ew 1.05e-140)))
(fabs (* t_1 (cos (atan (/ (* (- eh) (sin t)) t_1)))))
(fabs (* (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) (- (sin t))) eh)))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * ew;
double tmp;
if ((ew <= -4.3e-95) || !(ew <= 1.05e-140)) {
tmp = fabs((t_1 * cos(atan(((-eh * sin(t)) / t_1)))));
} else {
tmp = fabs(((tanh(asinh(((tan(t) / ew) * -eh))) * -sin(t)) * eh));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.cos(t) * ew tmp = 0 if (ew <= -4.3e-95) or not (ew <= 1.05e-140): tmp = math.fabs((t_1 * math.cos(math.atan(((-eh * math.sin(t)) / t_1))))) else: tmp = math.fabs(((math.tanh(math.asinh(((math.tan(t) / ew) * -eh))) * -math.sin(t)) * eh)) return tmp
function code(eh, ew, t) t_1 = Float64(cos(t) * ew) tmp = 0.0 if ((ew <= -4.3e-95) || !(ew <= 1.05e-140)) tmp = abs(Float64(t_1 * cos(atan(Float64(Float64(Float64(-eh) * sin(t)) / t_1))))); else tmp = abs(Float64(Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * Float64(-sin(t))) * eh)); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = cos(t) * ew; tmp = 0.0; if ((ew <= -4.3e-95) || ~((ew <= 1.05e-140))) tmp = abs((t_1 * cos(atan(((-eh * sin(t)) / t_1))))); else tmp = abs(((tanh(asinh(((tan(t) / ew) * -eh))) * -sin(t)) * eh)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[Or[LessEqual[ew, -4.3e-95], N[Not[LessEqual[ew, 1.05e-140]], $MachinePrecision]], N[Abs[N[(t$95$1 * N[Cos[N[ArcTan[N[(N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * (-N[Sin[t], $MachinePrecision])), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot ew\\
\mathbf{if}\;ew \leq -4.3 \cdot 10^{-95} \lor \neg \left(ew \leq 1.05 \cdot 10^{-140}\right):\\
\;\;\;\;\left|t\_1 \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \sin t}{t\_1}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(-\sin t\right)\right) \cdot eh\right|\\
\end{array}
\end{array}
if ew < -4.29999999999999997e-95 or 1.05000000000000009e-140 < ew Initial program 99.9%
Taylor expanded in t around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
Applied rewrites99.2%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6487.4
Applied rewrites87.4%
Taylor expanded in eh around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-cos.f64N/A
lower-atan.f64N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6479.6
Applied rewrites79.6%
if -4.29999999999999997e-95 < ew < 1.05000000000000009e-140Initial program 99.8%
Taylor expanded in eh around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
*-commutativeN/A
times-fracN/A
distribute-lft-neg-inN/A
Applied rewrites73.8%
Applied rewrites73.8%
Final simplification77.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (/ (tan t) ew) eh))
(t_2
(fabs
(*
(* (- (sin t)) eh)
(sin
(atan
(*
(fma (* 0.3333333333333333 (/ eh ew)) (* t t) (/ eh ew))
(- t)))))))
(t_3 (sqrt (PI))))
(if (<= t -6.2e-32)
t_2
(if (<= t -2.8e-92)
(fabs
(/ (fma (fma -0.5 ew (/ (* eh eh) ew)) (* t t) ew) (cosh (asinh t_1))))
(if (<= t 1.62e-9)
(fabs (* (sin (fma t_3 (/ t_3 2.0) (atan t_1))) ew))
t_2)))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\tan t}{ew} \cdot eh\\
t_2 := \left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{fma}\left(0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{eh}{ew}\right) \cdot \left(-t\right)\right)\right|\\
t_3 := \sqrt{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{-32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-92}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, ew, \frac{eh \cdot eh}{ew}\right), t \cdot t, ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\
\mathbf{elif}\;t \leq 1.62 \cdot 10^{-9}:\\
\;\;\;\;\left|\sin \left(\mathsf{fma}\left(t\_3, \frac{t\_3}{2}, \tan^{-1} t\_1\right)\right) \cdot ew\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.20000000000000021e-32 or 1.61999999999999999e-9 < t Initial program 99.7%
Taylor expanded in eh around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
*-commutativeN/A
times-fracN/A
distribute-lft-neg-inN/A
Applied rewrites54.8%
Taylor expanded in t around 0
Applied rewrites55.2%
if -6.20000000000000021e-32 < t < -2.8e-92Initial program 99.9%
Applied rewrites97.9%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6497.9
Applied rewrites97.9%
if -2.8e-92 < t < 1.61999999999999999e-9Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.9%
Applied rewrites80.8%
Applied rewrites80.9%
Final simplification69.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sqrt (PI))))
(if (or (<= t -9.2e-39) (not (<= t 1.62e-9)))
(fabs
(*
(* (- (sin t)) eh)
(sin
(atan
(* (fma (* 0.3333333333333333 (/ eh ew)) (* t t) (/ eh ew)) (- t))))))
(fabs (* (sin (fma t_1 (/ t_1 2.0) (atan (* (/ (tan t) ew) eh)))) ew)))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{-39} \lor \neg \left(t \leq 1.62 \cdot 10^{-9}\right):\\
\;\;\;\;\left|\left(\left(-\sin t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\mathsf{fma}\left(0.3333333333333333 \cdot \frac{eh}{ew}, t \cdot t, \frac{eh}{ew}\right) \cdot \left(-t\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \left(\mathsf{fma}\left(t\_1, \frac{t\_1}{2}, \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right)\right) \cdot ew\right|\\
\end{array}
\end{array}
if t < -9.20000000000000033e-39 or 1.61999999999999999e-9 < t Initial program 99.7%
Taylor expanded in eh around inf
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
*-commutativeN/A
times-fracN/A
distribute-lft-neg-inN/A
Applied rewrites54.8%
Taylor expanded in t around 0
Applied rewrites55.2%
if -9.20000000000000033e-39 < t < 1.61999999999999999e-9Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.3%
Applied rewrites80.1%
Applied rewrites80.3%
Final simplification67.7%
(FPCore (eh ew t) :precision binary64 (if (<= ew 9.5e-141) (* (sin t) eh) (* 1.0 ew)))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 9.5e-141) {
tmp = sin(t) * eh;
} else {
tmp = 1.0 * ew;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (ew <= 9.5d-141) then
tmp = sin(t) * eh
else
tmp = 1.0d0 * ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 9.5e-141) {
tmp = Math.sin(t) * eh;
} else {
tmp = 1.0 * ew;
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 9.5e-141: tmp = math.sin(t) * eh else: tmp = 1.0 * ew return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 9.5e-141) tmp = Float64(sin(t) * eh); else tmp = Float64(1.0 * ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 9.5e-141) tmp = sin(t) * eh; else tmp = 1.0 * ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 9.5e-141], N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision], N[(1.0 * ew), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 9.5 \cdot 10^{-141}:\\
\;\;\;\;\sin t \cdot eh\\
\mathbf{else}:\\
\;\;\;\;1 \cdot ew\\
\end{array}
\end{array}
if ew < 9.49999999999999996e-141Initial program 99.8%
Applied rewrites22.6%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites13.3%
Taylor expanded in eh around inf
Applied rewrites21.7%
if 9.49999999999999996e-141 < ew Initial program 99.9%
Applied rewrites58.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in ew around inf
Applied rewrites49.6%
Taylor expanded in t around 0
Applied rewrites56.3%
(FPCore (eh ew t)
:precision binary64
(if (<= ew -1.02e-303)
(*
(fma
(fma (* (* t t) eh) 0.008333333333333333 (* -0.16666666666666666 eh))
(* t t)
eh)
t)
(* 1.0 ew)))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.02e-303) {
tmp = fma(fma(((t * t) * eh), 0.008333333333333333, (-0.16666666666666666 * eh)), (t * t), eh) * t;
} else {
tmp = 1.0 * ew;
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (ew <= -1.02e-303) tmp = Float64(fma(fma(Float64(Float64(t * t) * eh), 0.008333333333333333, Float64(-0.16666666666666666 * eh)), Float64(t * t), eh) * t); else tmp = Float64(1.0 * ew); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.02e-303], N[(N[(N[(N[(N[(t * t), $MachinePrecision] * eh), $MachinePrecision] * 0.008333333333333333 + N[(-0.16666666666666666 * eh), $MachinePrecision]), $MachinePrecision] * N[(t * t), $MachinePrecision] + eh), $MachinePrecision] * t), $MachinePrecision], N[(1.0 * ew), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.02 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot t\right) \cdot eh, 0.008333333333333333, -0.16666666666666666 \cdot eh\right), t \cdot t, eh\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;1 \cdot ew\\
\end{array}
\end{array}
if ew < -1.01999999999999996e-303Initial program 99.9%
Applied rewrites18.3%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites10.8%
Taylor expanded in eh around inf
Applied rewrites16.5%
Taylor expanded in t around 0
Applied rewrites9.7%
if -1.01999999999999996e-303 < ew Initial program 99.8%
Applied rewrites52.4%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6433.4
Applied rewrites33.4%
Taylor expanded in ew around inf
Applied rewrites41.9%
Taylor expanded in t around 0
Applied rewrites47.1%
(FPCore (eh ew t) :precision binary64 (if (<= ew -1.02e-303) (* eh t) (* 1.0 ew)))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.02e-303) {
tmp = eh * t;
} else {
tmp = 1.0 * ew;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: tmp
if (ew <= (-1.02d-303)) then
tmp = eh * t
else
tmp = 1.0d0 * ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= -1.02e-303) {
tmp = eh * t;
} else {
tmp = 1.0 * ew;
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= -1.02e-303: tmp = eh * t else: tmp = 1.0 * ew return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= -1.02e-303) tmp = Float64(eh * t); else tmp = Float64(1.0 * ew); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= -1.02e-303) tmp = eh * t; else tmp = 1.0 * ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, -1.02e-303], N[(eh * t), $MachinePrecision], N[(1.0 * ew), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -1.02 \cdot 10^{-303}:\\
\;\;\;\;eh \cdot t\\
\mathbf{else}:\\
\;\;\;\;1 \cdot ew\\
\end{array}
\end{array}
if ew < -1.01999999999999996e-303Initial program 99.9%
Applied rewrites18.3%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites10.8%
Taylor expanded in eh around inf
Applied rewrites16.5%
Taylor expanded in t around 0
Applied rewrites9.7%
if -1.01999999999999996e-303 < ew Initial program 99.8%
Applied rewrites52.4%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6433.4
Applied rewrites33.4%
Taylor expanded in ew around inf
Applied rewrites41.9%
Taylor expanded in t around 0
Applied rewrites47.1%
(FPCore (eh ew t) :precision binary64 (* eh t))
double code(double eh, double ew, double t) {
return eh * t;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = eh * t
end function
public static double code(double eh, double ew, double t) {
return eh * t;
}
def code(eh, ew, t): return eh * t
function code(eh, ew, t) return Float64(eh * t) end
function tmp = code(eh, ew, t) tmp = eh * t; end
code[eh_, ew_, t_] := N[(eh * t), $MachinePrecision]
\begin{array}{l}
\\
eh \cdot t
\end{array}
Initial program 99.8%
Applied rewrites35.0%
Taylor expanded in ew around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites10.8%
Taylor expanded in eh around inf
Applied rewrites18.6%
Taylor expanded in t around 0
Applied rewrites9.5%
herbie shell --seed 2024343
(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)))))))