
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* eh (/ (tan t) ew))))) (fabs (fma (* (cos t) (cos t_1)) ew (* (* (sin t) eh) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh * (tan(t) / ew)));
return fabs(fma((cos(t) * cos(t_1)), ew, ((sin(t) * eh) * sin(t_1))));
}
function code(eh, ew, t) t_1 = atan(Float64(eh * Float64(tan(t) / ew))) return abs(fma(Float64(cos(t) * cos(t_1)), ew, Float64(Float64(sin(t) * eh) * sin(t_1)))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
\left|\mathsf{fma}\left(\cos t \cdot \cos t\_1, ew, \left(\sin t \cdot eh\right) \cdot \sin t\_1\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (fma (* (cos t) (cos (atan (* eh (/ (tan t) ew))))) ew (* (* (sin t) eh) (sin (atan (* (/ t ew) eh)))))))
double code(double eh, double ew, double t) {
return fabs(fma((cos(t) * cos(atan((eh * (tan(t) / ew))))), ew, ((sin(t) * eh) * sin(atan(((t / ew) * eh))))));
}
function code(eh, ew, t) return abs(fma(Float64(cos(t) * cos(atan(Float64(eh * Float64(tan(t) / ew))))), ew, Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(t / ew) * eh)))))) end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(\cos t \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right), ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh))
(t_2
(fabs
(/
(+ (* t_1 (* eh (/ (tan t) ew))) (* (cos t) ew))
(/ 1.0 (pow (+ 1.0 (pow (/ ew (* eh (tan t))) -2.0)) -0.5))))))
(if (<= ew -1.85e+22)
t_2
(if (<= ew 1.8e-10)
(fabs
(fma
(* (cos (atan (/ (* eh t) ew))) (cos t))
ew
(* t_1 (sin (atan (* (/ t ew) eh))))))
t_2))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double t_2 = fabs((((t_1 * (eh * (tan(t) / ew))) + (cos(t) * ew)) / (1.0 / pow((1.0 + pow((ew / (eh * tan(t))), -2.0)), -0.5))));
double tmp;
if (ew <= -1.85e+22) {
tmp = t_2;
} else if (ew <= 1.8e-10) {
tmp = fabs(fma((cos(atan(((eh * t) / ew))) * cos(t)), ew, (t_1 * sin(atan(((t / ew) * eh))))));
} else {
tmp = t_2;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) t_2 = abs(Float64(Float64(Float64(t_1 * Float64(eh * Float64(tan(t) / ew))) + Float64(cos(t) * ew)) / Float64(1.0 / (Float64(1.0 + (Float64(ew / Float64(eh * tan(t))) ^ -2.0)) ^ -0.5)))) tmp = 0.0 if (ew <= -1.85e+22) tmp = t_2; elseif (ew <= 1.8e-10) tmp = abs(fma(Float64(cos(atan(Float64(Float64(eh * t) / ew))) * cos(t)), ew, Float64(t_1 * sin(atan(Float64(Float64(t / ew) * eh)))))); else tmp = t_2; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[(N[(t$95$1 * N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Power[N[(1.0 + N[Power[N[(ew / N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.85e+22], t$95$2, If[LessEqual[ew, 1.8e-10], N[Abs[N[(N[(N[Cos[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * ew + N[(t$95$1 * N[Sin[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := \left|\frac{t\_1 \cdot \left(eh \cdot \frac{\tan t}{ew}\right) + \cos t \cdot ew}{\frac{1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\
\mathbf{if}\;ew \leq -1.85 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 1.8 \cdot 10^{-10}:\\
\;\;\;\;\left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, t\_1 \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -1.8499999999999999e22 or 1.8e-10 < ew Initial program 99.8%
Applied rewrites86.4%
Applied rewrites95.8%
if -1.8499999999999999e22 < ew < 1.8e-10Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6495.8
Applied rewrites95.8%
Final simplification95.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(fma
(* (cos (atan (/ (* eh t) ew))) (cos t))
ew
(* (* (sin t) eh) (sin (atan (* (/ t ew) eh))))))))
(if (<= eh -1.55e+60)
t_1
(if (<= eh 9.6e-20)
(/
1.0
(/
(sqrt (+ 1.0 (pow (/ ew (* eh (tan t))) -2.0)))
(fabs (+ (* (* (* eh (/ (tan t) ew)) eh) (sin t)) (* (cos t) ew)))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs(fma((cos(atan(((eh * t) / ew))) * cos(t)), ew, ((sin(t) * eh) * sin(atan(((t / ew) * eh))))));
double tmp;
if (eh <= -1.55e+60) {
tmp = t_1;
} else if (eh <= 9.6e-20) {
tmp = 1.0 / (sqrt((1.0 + pow((ew / (eh * tan(t))), -2.0))) / fabs(((((eh * (tan(t) / ew)) * eh) * sin(t)) + (cos(t) * ew))));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(fma(Float64(cos(atan(Float64(Float64(eh * t) / ew))) * cos(t)), ew, Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(t / ew) * eh)))))) tmp = 0.0 if (eh <= -1.55e+60) tmp = t_1; elseif (eh <= 9.6e-20) tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + (Float64(ew / Float64(eh * tan(t))) ^ -2.0))) / abs(Float64(Float64(Float64(Float64(eh * Float64(tan(t) / ew)) * eh) * sin(t)) + Float64(cos(t) * ew))))); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[(N[Cos[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.55e+60], t$95$1, If[LessEqual[eh, 9.6e-20], N[(1.0 / N[(N[Sqrt[N[(1.0 + N[Power[N[(ew / N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Abs[N[(N[(N[(N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\mathsf{fma}\left(\cos \tan^{-1} \left(\frac{eh \cdot t}{ew}\right) \cdot \cos t, ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|\\
\mathbf{if}\;eh \leq -1.55 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 9.6 \cdot 10^{-20}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + \cos t \cdot ew\right|}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -1.55e60 or 9.59999999999999971e-20 < eh Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f6499.6
Applied rewrites99.6%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6492.3
Applied rewrites92.3%
if -1.55e60 < eh < 9.59999999999999971e-20Initial program 99.8%
Applied rewrites99.8%
Applied rewrites83.9%
lift-pow.f64N/A
inv-powN/A
lift-cos.f64N/A
lift-atan.f64N/A
cos-atanN/A
remove-double-divN/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites97.4%
Final simplification95.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh))
(t_2 (* (cos t) ew))
(t_3
(/
1.0
(/
(sqrt (+ 1.0 (pow (/ ew (* eh (tan t))) -2.0)))
(fabs (+ (* (* (* eh (/ (tan t) ew)) eh) (sin t)) t_2)))))
(t_4
(fabs
(* (sin (atan (* (/ (sin t) t_2) (- eh)))) (* (- eh) (sin t))))))
(if (<= eh -3.3e+93)
(/ 1.0 (fabs (/ 1.0 (* (sin (atan (/ (/ t_1 ew) (cos t)))) t_1))))
(if (<= eh 4.8e+70)
t_3
(if (<= eh 1.95e+139) t_4 (if (<= eh 4e+192) t_3 t_4))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double t_2 = cos(t) * ew;
double t_3 = 1.0 / (sqrt((1.0 + pow((ew / (eh * tan(t))), -2.0))) / fabs(((((eh * (tan(t) / ew)) * eh) * sin(t)) + t_2)));
double t_4 = fabs((sin(atan(((sin(t) / t_2) * -eh))) * (-eh * sin(t))));
double tmp;
if (eh <= -3.3e+93) {
tmp = 1.0 / fabs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)));
} else if (eh <= 4.8e+70) {
tmp = t_3;
} else if (eh <= 1.95e+139) {
tmp = t_4;
} else if (eh <= 4e+192) {
tmp = t_3;
} else {
tmp = t_4;
}
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 = sin(t) * eh
t_2 = cos(t) * ew
t_3 = 1.0d0 / (sqrt((1.0d0 + ((ew / (eh * tan(t))) ** (-2.0d0)))) / abs(((((eh * (tan(t) / ew)) * eh) * sin(t)) + t_2)))
t_4 = abs((sin(atan(((sin(t) / t_2) * -eh))) * (-eh * sin(t))))
if (eh <= (-3.3d+93)) then
tmp = 1.0d0 / abs((1.0d0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)))
else if (eh <= 4.8d+70) then
tmp = t_3
else if (eh <= 1.95d+139) then
tmp = t_4
else if (eh <= 4d+192) then
tmp = t_3
else
tmp = t_4
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * eh;
double t_2 = Math.cos(t) * ew;
double t_3 = 1.0 / (Math.sqrt((1.0 + Math.pow((ew / (eh * Math.tan(t))), -2.0))) / Math.abs(((((eh * (Math.tan(t) / ew)) * eh) * Math.sin(t)) + t_2)));
double t_4 = Math.abs((Math.sin(Math.atan(((Math.sin(t) / t_2) * -eh))) * (-eh * Math.sin(t))));
double tmp;
if (eh <= -3.3e+93) {
tmp = 1.0 / Math.abs((1.0 / (Math.sin(Math.atan(((t_1 / ew) / Math.cos(t)))) * t_1)));
} else if (eh <= 4.8e+70) {
tmp = t_3;
} else if (eh <= 1.95e+139) {
tmp = t_4;
} else if (eh <= 4e+192) {
tmp = t_3;
} else {
tmp = t_4;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * eh t_2 = math.cos(t) * ew t_3 = 1.0 / (math.sqrt((1.0 + math.pow((ew / (eh * math.tan(t))), -2.0))) / math.fabs(((((eh * (math.tan(t) / ew)) * eh) * math.sin(t)) + t_2))) t_4 = math.fabs((math.sin(math.atan(((math.sin(t) / t_2) * -eh))) * (-eh * math.sin(t)))) tmp = 0 if eh <= -3.3e+93: tmp = 1.0 / math.fabs((1.0 / (math.sin(math.atan(((t_1 / ew) / math.cos(t)))) * t_1))) elif eh <= 4.8e+70: tmp = t_3 elif eh <= 1.95e+139: tmp = t_4 elif eh <= 4e+192: tmp = t_3 else: tmp = t_4 return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) t_2 = Float64(cos(t) * ew) t_3 = Float64(1.0 / Float64(sqrt(Float64(1.0 + (Float64(ew / Float64(eh * tan(t))) ^ -2.0))) / abs(Float64(Float64(Float64(Float64(eh * Float64(tan(t) / ew)) * eh) * sin(t)) + t_2)))) t_4 = abs(Float64(sin(atan(Float64(Float64(sin(t) / t_2) * Float64(-eh)))) * Float64(Float64(-eh) * sin(t)))) tmp = 0.0 if (eh <= -3.3e+93) tmp = Float64(1.0 / abs(Float64(1.0 / Float64(sin(atan(Float64(Float64(t_1 / ew) / cos(t)))) * t_1)))); elseif (eh <= 4.8e+70) tmp = t_3; elseif (eh <= 1.95e+139) tmp = t_4; elseif (eh <= 4e+192) tmp = t_3; else tmp = t_4; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * eh; t_2 = cos(t) * ew; t_3 = 1.0 / (sqrt((1.0 + ((ew / (eh * tan(t))) ^ -2.0))) / abs(((((eh * (tan(t) / ew)) * eh) * sin(t)) + t_2))); t_4 = abs((sin(atan(((sin(t) / t_2) * -eh))) * (-eh * sin(t)))); tmp = 0.0; if (eh <= -3.3e+93) tmp = 1.0 / abs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1))); elseif (eh <= 4.8e+70) tmp = t_3; elseif (eh <= 1.95e+139) tmp = t_4; elseif (eh <= 4e+192) tmp = t_3; else tmp = t_4; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[N[(1.0 + N[Power[N[(ew / N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Abs[N[(N[(N[(N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / t$95$2), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -3.3e+93], N[(1.0 / N[Abs[N[(1.0 / N[(N[Sin[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[eh, 4.8e+70], t$95$3, If[LessEqual[eh, 1.95e+139], t$95$4, If[LessEqual[eh, 4e+192], t$95$3, t$95$4]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := \cos t \cdot ew\\
t_3 := \frac{1}{\frac{\sqrt{1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}}}{\left|\left(\left(eh \cdot \frac{\tan t}{ew}\right) \cdot eh\right) \cdot \sin t + t\_2\right|}}\\
t_4 := \left|\sin \tan^{-1} \left(\frac{\sin t}{t\_2} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
\mathbf{if}\;eh \leq -3.3 \cdot 10^{+93}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\
\mathbf{elif}\;eh \leq 4.8 \cdot 10^{+70}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eh \leq 1.95 \cdot 10^{+139}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eh \leq 4 \cdot 10^{+192}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if eh < -3.30000000000000009e93Initial program 99.8%
Applied rewrites99.7%
Taylor expanded in ew around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-cos.f6474.4
Applied rewrites74.4%
if -3.30000000000000009e93 < eh < 4.79999999999999974e70 or 1.95000000000000003e139 < eh < 4.00000000000000016e192Initial program 99.8%
Applied rewrites99.8%
Applied rewrites79.9%
lift-pow.f64N/A
inv-powN/A
lift-cos.f64N/A
lift-atan.f64N/A
cos-atanN/A
remove-double-divN/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites95.5%
if 4.79999999999999974e70 < eh < 1.95000000000000003e139 or 4.00000000000000016e192 < eh Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites14.4%
Taylor expanded in t around 0
Applied rewrites13.5%
Taylor expanded in ew around 0
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
Applied rewrites86.7%
Final simplification90.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)) (t_2 (* (cos t) ew)))
(if (<= eh -8e+86)
(/ 1.0 (fabs (/ 1.0 (* (sin (atan (/ (/ t_1 ew) (cos t)))) t_1))))
(if (<= eh 4.8e+70)
(/
(fabs (fma (* (* eh (tan t)) eh) (/ (sin t) ew) t_2))
(sqrt (+ 1.0 (pow (* eh (/ (tan t) ew)) 2.0))))
(fabs
(* (sin (atan (* (/ (sin t) t_2) (- eh)))) (* (- eh) (sin t))))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double t_2 = cos(t) * ew;
double tmp;
if (eh <= -8e+86) {
tmp = 1.0 / fabs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)));
} else if (eh <= 4.8e+70) {
tmp = fabs(fma(((eh * tan(t)) * eh), (sin(t) / ew), t_2)) / sqrt((1.0 + pow((eh * (tan(t) / ew)), 2.0)));
} else {
tmp = fabs((sin(atan(((sin(t) / t_2) * -eh))) * (-eh * sin(t))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) t_2 = Float64(cos(t) * ew) tmp = 0.0 if (eh <= -8e+86) tmp = Float64(1.0 / abs(Float64(1.0 / Float64(sin(atan(Float64(Float64(t_1 / ew) / cos(t)))) * t_1)))); elseif (eh <= 4.8e+70) tmp = Float64(abs(fma(Float64(Float64(eh * tan(t)) * eh), Float64(sin(t) / ew), t_2)) / sqrt(Float64(1.0 + (Float64(eh * Float64(tan(t) / ew)) ^ 2.0)))); else tmp = abs(Float64(sin(atan(Float64(Float64(sin(t) / t_2) * Float64(-eh)))) * Float64(Float64(-eh) * sin(t)))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[eh, -8e+86], N[(1.0 / N[Abs[N[(1.0 / N[(N[Sin[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[eh, 4.8e+70], N[(N[Abs[N[(N[(N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / t$95$2), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := \cos t \cdot ew\\
\mathbf{if}\;eh \leq -8 \cdot 10^{+86}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\
\mathbf{elif}\;eh \leq 4.8 \cdot 10^{+70}:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(\left(eh \cdot \tan t\right) \cdot eh, \frac{\sin t}{ew}, t\_2\right)\right|}{\sqrt{1 + {\left(eh \cdot \frac{\tan t}{ew}\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{t\_2} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
\end{array}
\end{array}
if eh < -8.0000000000000001e86Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-cos.f6475.6
Applied rewrites75.6%
if -8.0000000000000001e86 < eh < 4.79999999999999974e70Initial program 99.7%
Applied rewrites99.6%
Applied rewrites80.6%
Applied rewrites92.0%
if 4.79999999999999974e70 < eh Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites21.0%
Taylor expanded in t around 0
Applied rewrites19.9%
Taylor expanded in ew around 0
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
Applied rewrites77.5%
Final simplification86.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)))
(if (<= eh -6e+85)
(/ 1.0 (fabs (/ 1.0 (* (sin (atan (/ (/ t_1 ew) (cos t)))) t_1))))
(if (<= eh 3.7e+63)
(fabs
(/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* eh (/ (tan t) ew)))))))
(fabs
(*
(sin (atan (* (/ (sin t) (* (cos t) ew)) (- eh))))
(* (- eh) (sin t))))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double tmp;
if (eh <= -6e+85) {
tmp = 1.0 / fabs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)));
} else if (eh <= 3.7e+63) {
tmp = fabs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
} else {
tmp = fabs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(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) :: t_1
real(8) :: tmp
t_1 = sin(t) * eh
if (eh <= (-6d+85)) then
tmp = 1.0d0 / abs((1.0d0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1)))
else if (eh <= 3.7d+63) then
tmp = abs(((-ew * cos(t)) / ((-1.0d0) / cos(atan((eh * (tan(t) / ew)))))))
else
tmp = abs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * eh;
double tmp;
if (eh <= -6e+85) {
tmp = 1.0 / Math.abs((1.0 / (Math.sin(Math.atan(((t_1 / ew) / Math.cos(t)))) * t_1)));
} else if (eh <= 3.7e+63) {
tmp = Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan((eh * (Math.tan(t) / ew)))))));
} else {
tmp = Math.abs((Math.sin(Math.atan(((Math.sin(t) / (Math.cos(t) * ew)) * -eh))) * (-eh * Math.sin(t))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * eh tmp = 0 if eh <= -6e+85: tmp = 1.0 / math.fabs((1.0 / (math.sin(math.atan(((t_1 / ew) / math.cos(t)))) * t_1))) elif eh <= 3.7e+63: tmp = math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan((eh * (math.tan(t) / ew))))))) else: tmp = math.fabs((math.sin(math.atan(((math.sin(t) / (math.cos(t) * ew)) * -eh))) * (-eh * math.sin(t)))) return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) tmp = 0.0 if (eh <= -6e+85) tmp = Float64(1.0 / abs(Float64(1.0 / Float64(sin(atan(Float64(Float64(t_1 / ew) / cos(t)))) * t_1)))); elseif (eh <= 3.7e+63) tmp = abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(eh * Float64(tan(t) / ew))))))); else tmp = abs(Float64(sin(atan(Float64(Float64(sin(t) / Float64(cos(t) * ew)) * Float64(-eh)))) * Float64(Float64(-eh) * sin(t)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * eh; tmp = 0.0; if (eh <= -6e+85) tmp = 1.0 / abs((1.0 / (sin(atan(((t_1 / ew) / cos(t)))) * t_1))); elseif (eh <= 3.7e+63) tmp = abs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew))))))); else tmp = abs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -6e+85], N[(1.0 / N[Abs[N[(1.0 / N[(N[Sin[N[ArcTan[N[(N[(t$95$1 / ew), $MachinePrecision] / N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[eh, 3.7e+63], N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
\mathbf{if}\;eh \leq -6 \cdot 10^{+85}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{\sin \tan^{-1} \left(\frac{\frac{t\_1}{ew}}{\cos t}\right) \cdot t\_1}\right|}\\
\mathbf{elif}\;eh \leq 3.7 \cdot 10^{+63}:\\
\;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
\end{array}
\end{array}
if eh < -6.0000000000000001e85Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in ew around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-cos.f6475.6
Applied rewrites75.6%
if -6.0000000000000001e85 < eh < 3.69999999999999968e63Initial program 99.8%
Applied rewrites81.5%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6479.7
Applied rewrites79.7%
if 3.69999999999999968e63 < eh Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites22.2%
Taylor expanded in t around 0
Applied rewrites21.1%
Taylor expanded in ew around 0
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
Applied rewrites76.6%
Final simplification78.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(*
(sin (atan (* (/ (sin t) (* (cos t) ew)) (- eh))))
(* (- eh) (sin t))))))
(if (<= eh -6e+85)
t_1
(if (<= eh 3.7e+63)
(fabs
(/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* eh (/ (tan t) ew)))))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))));
double tmp;
if (eh <= -6e+85) {
tmp = t_1;
} else if (eh <= 3.7e+63) {
tmp = fabs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = abs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t))))
if (eh <= (-6d+85)) then
tmp = t_1
else if (eh <= 3.7d+63) then
tmp = abs(((-ew * cos(t)) / ((-1.0d0) / cos(atan((eh * (tan(t) / ew)))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((Math.sin(Math.atan(((Math.sin(t) / (Math.cos(t) * ew)) * -eh))) * (-eh * Math.sin(t))));
double tmp;
if (eh <= -6e+85) {
tmp = t_1;
} else if (eh <= 3.7e+63) {
tmp = Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan((eh * (Math.tan(t) / ew)))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(math.atan(((math.sin(t) / (math.cos(t) * ew)) * -eh))) * (-eh * math.sin(t)))) tmp = 0 if eh <= -6e+85: tmp = t_1 elif eh <= 3.7e+63: tmp = math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan((eh * (math.tan(t) / ew))))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(atan(Float64(Float64(sin(t) / Float64(cos(t) * ew)) * Float64(-eh)))) * Float64(Float64(-eh) * sin(t)))) tmp = 0.0 if (eh <= -6e+85) tmp = t_1; elseif (eh <= 3.7e+63) tmp = abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(eh * Float64(tan(t) / ew))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(atan(((sin(t) / (cos(t) * ew)) * -eh))) * (-eh * sin(t)))); tmp = 0.0; if (eh <= -6e+85) tmp = t_1; elseif (eh <= 3.7e+63) tmp = abs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew))))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -6e+85], t$95$1, If[LessEqual[eh, 3.7e+63], N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin \tan^{-1} \left(\frac{\sin t}{\cos t \cdot ew} \cdot \left(-eh\right)\right) \cdot \left(\left(-eh\right) \cdot \sin t\right)\right|\\
\mathbf{if}\;eh \leq -6 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 3.7 \cdot 10^{+63}:\\
\;\;\;\;\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -6.0000000000000001e85 or 3.69999999999999968e63 < eh Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites20.7%
Taylor expanded in t around 0
Applied rewrites19.6%
Taylor expanded in ew around 0
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
Applied rewrites76.1%
if -6.0000000000000001e85 < eh < 3.69999999999999968e63Initial program 99.8%
Applied rewrites81.5%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6479.7
Applied rewrites79.7%
Final simplification78.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* eh (/ (tan t) ew)))))))))
(if (<= t -3.5e+19)
t_1
(if (<= t 4.7e-17)
(fabs
(/
(- (/ (* (* eh t) (* eh t)) (- ew)) (* (cos t) ew))
(/ -1.0 (pow (+ 1.0 (pow (/ ew (* eh (tan t))) -2.0)) -0.5))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew)))))));
double tmp;
if (t <= -3.5e+19) {
tmp = t_1;
} else if (t <= 4.7e-17) {
tmp = fabs((((((eh * t) * (eh * t)) / -ew) - (cos(t) * ew)) / (-1.0 / pow((1.0 + pow((ew / (eh * tan(t))), -2.0)), -0.5))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = abs(((-ew * cos(t)) / ((-1.0d0) / cos(atan((eh * (tan(t) / ew)))))))
if (t <= (-3.5d+19)) then
tmp = t_1
else if (t <= 4.7d-17) then
tmp = abs((((((eh * t) * (eh * t)) / -ew) - (cos(t) * ew)) / ((-1.0d0) / ((1.0d0 + ((ew / (eh * tan(t))) ** (-2.0d0))) ** (-0.5d0)))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan((eh * (Math.tan(t) / ew)))))));
double tmp;
if (t <= -3.5e+19) {
tmp = t_1;
} else if (t <= 4.7e-17) {
tmp = Math.abs((((((eh * t) * (eh * t)) / -ew) - (Math.cos(t) * ew)) / (-1.0 / Math.pow((1.0 + Math.pow((ew / (eh * Math.tan(t))), -2.0)), -0.5))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan((eh * (math.tan(t) / ew))))))) tmp = 0 if t <= -3.5e+19: tmp = t_1 elif t <= 4.7e-17: tmp = math.fabs((((((eh * t) * (eh * t)) / -ew) - (math.cos(t) * ew)) / (-1.0 / math.pow((1.0 + math.pow((ew / (eh * math.tan(t))), -2.0)), -0.5)))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(eh * Float64(tan(t) / ew))))))) tmp = 0.0 if (t <= -3.5e+19) tmp = t_1; elseif (t <= 4.7e-17) tmp = abs(Float64(Float64(Float64(Float64(Float64(eh * t) * Float64(eh * t)) / Float64(-ew)) - Float64(cos(t) * ew)) / Float64(-1.0 / (Float64(1.0 + (Float64(ew / Float64(eh * tan(t))) ^ -2.0)) ^ -0.5)))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew))))))); tmp = 0.0; if (t <= -3.5e+19) tmp = t_1; elseif (t <= 4.7e-17) tmp = abs((((((eh * t) * (eh * t)) / -ew) - (cos(t) * ew)) / (-1.0 / ((1.0 + ((ew / (eh * tan(t))) ^ -2.0)) ^ -0.5)))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.5e+19], t$95$1, If[LessEqual[t, 4.7e-17], N[Abs[N[(N[(N[(N[(N[(eh * t), $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision] - N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Power[N[(1.0 + N[Power[N[(ew / N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{-17}:\\
\;\;\;\;\left|\frac{\frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{-ew} - \cos t \cdot ew}{\frac{-1}{{\left(1 + {\left(\frac{ew}{eh \cdot \tan t}\right)}^{-2}\right)}^{-0.5}}}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.5e19 or 4.7e-17 < t Initial program 99.6%
Applied rewrites49.1%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6447.5
Applied rewrites47.5%
if -3.5e19 < t < 4.7e-17Initial program 100.0%
Applied rewrites75.5%
Taylor expanded in t around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6473.8
Applied rewrites73.8%
lift-cos.f64N/A
lift-atan.f64N/A
cos-atanN/A
inv-powN/A
sqrt-pow2N/A
lower-pow.f64N/A
Applied rewrites82.8%
Final simplification65.2%
(FPCore (eh ew t) :precision binary64 (fabs (/ (* (- ew) (cos t)) (/ -1.0 (cos (atan (* eh (/ (tan t) ew))))))))
double code(double eh, double ew, double t) {
return fabs(((-ew * cos(t)) / (-1.0 / 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(((-ew * cos(t)) / ((-1.0d0) / cos(atan((eh * (tan(t) / ew)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs(((-ew * Math.cos(t)) / (-1.0 / Math.cos(Math.atan((eh * (Math.tan(t) / ew)))))));
}
def code(eh, ew, t): return math.fabs(((-ew * math.cos(t)) / (-1.0 / math.cos(math.atan((eh * (math.tan(t) / ew)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(-ew) * cos(t)) / Float64(-1.0 / cos(atan(Float64(eh * Float64(tan(t) / ew))))))) end
function tmp = code(eh, ew, t) tmp = abs(((-ew * cos(t)) / (-1.0 / cos(atan((eh * (tan(t) / ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[((-ew) * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{\left(-ew\right) \cdot \cos t}{\frac{-1}{\cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)}}\right|
\end{array}
Initial program 99.8%
Applied rewrites62.3%
Taylor expanded in ew around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f6460.1
Applied rewrites60.1%
Final simplification60.1%
(FPCore (eh ew t) :precision binary64 (fabs (/ (- (* (cos t) ew) (/ (* (* eh t) (* eh t)) (- ew))) (/ 1.0 (cos (atan (* (/ eh ew) t)))))))
double code(double eh, double ew, double t) {
return fabs((((cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0 / cos(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((((cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0d0 / cos(atan(((eh / ew) * t))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((Math.cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0 / Math.cos(Math.atan(((eh / ew) * t))))));
}
def code(eh, ew, t): return math.fabs((((math.cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0 / math.cos(math.atan(((eh / ew) * t))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(cos(t) * ew) - Float64(Float64(Float64(eh * t) * Float64(eh * t)) / Float64(-ew))) / Float64(1.0 / cos(atan(Float64(Float64(eh / ew) * t)))))) end
function tmp = code(eh, ew, t) tmp = abs((((cos(t) * ew) - (((eh * t) * (eh * t)) / -ew)) / (1.0 / cos(atan(((eh / ew) * t)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] - N[(N[(N[(eh * t), $MachinePrecision] * N[(eh * t), $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{\cos t \cdot ew - \frac{\left(eh \cdot t\right) \cdot \left(eh \cdot t\right)}{-ew}}{\frac{1}{\cos \tan^{-1} \left(\frac{eh}{ew} \cdot t\right)}}\right|
\end{array}
Initial program 99.8%
Applied rewrites62.3%
Taylor expanded in t around 0
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6448.8
Applied rewrites48.8%
Taylor expanded in t around 0
*-commutativeN/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
Final simplification48.8%
(FPCore (eh ew t) :precision binary64 (fabs (/ ew 1.0)))
double code(double eh, double ew, double t) {
return fabs((ew / 1.0));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew / 1.0d0))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew / 1.0));
}
def code(eh, ew, t): return math.fabs((ew / 1.0))
function code(eh, ew, t) return abs(Float64(ew / 1.0)) end
function tmp = code(eh, ew, t) tmp = abs((ew / 1.0)); end
code[eh_, ew_, t_] := N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{1}\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites41.6%
Taylor expanded in t around 0
Applied rewrites40.2%
Applied rewrites39.3%
Taylor expanded in ew around inf
Applied rewrites41.7%
herbie shell --seed 2024259
(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)))))))