
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* (/ (tan t) ew) eh)))) (fabs (fma (* (- (sin t)) eh) (- (sin t_1)) (* (* (cos t) ew) (cos t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((tan(t) / ew) * eh));
return fabs(fma((-sin(t) * eh), -sin(t_1), ((cos(t) * ew) * cos(t_1))));
}
function code(eh, ew, t) t_1 = atan(Float64(Float64(tan(t) / ew) * eh)) return abs(fma(Float64(Float64(-sin(t)) * eh), Float64(-sin(t_1)), Float64(Float64(cos(t) * ew) * cos(t_1)))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision] * (-N[Sin[t$95$1], $MachinePrecision]) + N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\
\left|\mathsf{fma}\left(\left(-\sin t\right) \cdot eh, -\sin t\_1, \left(\cos t \cdot ew\right) \cdot \cos t\_1\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Final simplification99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) ew))
(t_2 (* eh (sin t)))
(t_3 (atan (/ (* (tan t) eh) (- ew))))
(t_4 (- (* (cos t_3) t_1) (* t_2 (sin t_3))))
(t_5 (* (/ (tan t) ew) eh))
(t_6 (fabs (/ (+ (* t_2 t_5) t_1) (/ -1.0 (cos (atan t_5)))))))
(if (<= t_4 -2e+280)
t_6
(if (<= t_4 -4e+221)
(fabs
(*
(sin
(atan (* (/ (fma -0.3333333333333333 (* (* eh t) t) (- eh)) ew) t)))
(* (- (sin t)) eh)))
(if (<= t_4 -2e-277)
t_6
(fma
(* (sin (atan (* (/ (- eh) ew) (tan t)))) (sin t))
(- eh)
(* (/ 1.0 (sqrt (+ 1.0 (pow t_5 2.0)))) t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * ew;
double t_2 = eh * sin(t);
double t_3 = atan(((tan(t) * eh) / -ew));
double t_4 = (cos(t_3) * t_1) - (t_2 * sin(t_3));
double t_5 = (tan(t) / ew) * eh;
double t_6 = fabs((((t_2 * t_5) + t_1) / (-1.0 / cos(atan(t_5)))));
double tmp;
if (t_4 <= -2e+280) {
tmp = t_6;
} else if (t_4 <= -4e+221) {
tmp = fabs((sin(atan(((fma(-0.3333333333333333, ((eh * t) * t), -eh) / ew) * t))) * (-sin(t) * eh)));
} else if (t_4 <= -2e-277) {
tmp = t_6;
} else {
tmp = fma((sin(atan(((-eh / ew) * tan(t)))) * sin(t)), -eh, ((1.0 / sqrt((1.0 + pow(t_5, 2.0)))) * t_1));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(cos(t) * ew) t_2 = Float64(eh * sin(t)) t_3 = atan(Float64(Float64(tan(t) * eh) / Float64(-ew))) t_4 = Float64(Float64(cos(t_3) * t_1) - Float64(t_2 * sin(t_3))) t_5 = Float64(Float64(tan(t) / ew) * eh) t_6 = abs(Float64(Float64(Float64(t_2 * t_5) + t_1) / Float64(-1.0 / cos(atan(t_5))))) tmp = 0.0 if (t_4 <= -2e+280) tmp = t_6; elseif (t_4 <= -4e+221) tmp = abs(Float64(sin(atan(Float64(Float64(fma(-0.3333333333333333, Float64(Float64(eh * t) * t), Float64(-eh)) / ew) * t))) * Float64(Float64(-sin(t)) * eh))); elseif (t_4 <= -2e-277) tmp = t_6; else tmp = fma(Float64(sin(atan(Float64(Float64(Float64(-eh) / ew) * tan(t)))) * sin(t)), Float64(-eh), Float64(Float64(1.0 / sqrt(Float64(1.0 + (t_5 ^ 2.0)))) * t_1)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Cos[t$95$3], $MachinePrecision] * t$95$1), $MachinePrecision] - N[(t$95$2 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$6 = N[Abs[N[(N[(N[(t$95$2 * t$95$5), $MachinePrecision] + t$95$1), $MachinePrecision] / N[(-1.0 / N[Cos[N[ArcTan[t$95$5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, -2e+280], t$95$6, If[LessEqual[t$95$4, -4e+221], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(-0.3333333333333333 * N[(N[(eh * t), $MachinePrecision] * t), $MachinePrecision] + (-eh)), $MachinePrecision] / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, -2e-277], t$95$6, N[(N[(N[Sin[N[ArcTan[N[(N[((-eh) / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] * (-eh) + N[(N[(1.0 / N[Sqrt[N[(1.0 + N[Power[t$95$5, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot ew\\
t_2 := eh \cdot \sin t\\
t_3 := \tan^{-1} \left(\frac{\tan t \cdot eh}{-ew}\right)\\
t_4 := \cos t\_3 \cdot t\_1 - t\_2 \cdot \sin t\_3\\
t_5 := \frac{\tan t}{ew} \cdot eh\\
t_6 := \left|\frac{t\_2 \cdot t\_5 + t\_1}{\frac{-1}{\cos \tan^{-1} t\_5}}\right|\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+280}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_4 \leq -4 \cdot 10^{+221}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \left(eh \cdot t\right) \cdot t, -eh\right)}{ew} \cdot t\right) \cdot \left(\left(-\sin t\right) \cdot eh\right)\right|\\
\mathbf{elif}\;t\_4 \leq -2 \cdot 10^{-277}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{-eh}{ew} \cdot \tan t\right) \cdot \sin t, -eh, \frac{1}{\sqrt{1 + {t\_5}^{2}}} \cdot t\_1\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))))) < -2.0000000000000001e280 or -4.0000000000000002e221 < (-.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.99999999999999994e-277Initial program 99.8%
Applied rewrites67.2%
if -2.0000000000000001e280 < (-.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))))) < -4.0000000000000002e221Initial program 99.6%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites77.9%
Taylor expanded in t around 0
Applied rewrites78.0%
Taylor expanded in t around 0
Applied rewrites78.0%
if -1.99999999999999994e-277 < (-.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 rewrites99.8%
Applied rewrites99.8%
Applied rewrites99.8%
Final simplification85.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (/ (tan t) ew) eh))
(t_2 (+ (* (* eh (sin t)) t_1) (* (cos t) ew)))
(t_3 (fabs (/ t_2 (/ -1.0 (cos (atan t_1)))))))
(if (<= ew -3.8e-64)
t_3
(if (<= ew 3.55e-171)
(fabs
(* (sin (atan (* (/ eh (cos t)) (/ (- t) ew)))) (* (- (sin t)) eh)))
(if (<= ew 2.6e-90) (/ t_2 (sqrt (+ 1.0 (pow t_1 2.0)))) t_3)))))
double code(double eh, double ew, double t) {
double t_1 = (tan(t) / ew) * eh;
double t_2 = ((eh * sin(t)) * t_1) + (cos(t) * ew);
double t_3 = fabs((t_2 / (-1.0 / cos(atan(t_1)))));
double tmp;
if (ew <= -3.8e-64) {
tmp = t_3;
} else if (ew <= 3.55e-171) {
tmp = fabs((sin(atan(((eh / cos(t)) * (-t / ew)))) * (-sin(t) * eh)));
} else if (ew <= 2.6e-90) {
tmp = t_2 / sqrt((1.0 + pow(t_1, 2.0)));
} else {
tmp = t_3;
}
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) :: tmp
t_1 = (tan(t) / ew) * eh
t_2 = ((eh * sin(t)) * t_1) + (cos(t) * ew)
t_3 = abs((t_2 / ((-1.0d0) / cos(atan(t_1)))))
if (ew <= (-3.8d-64)) then
tmp = t_3
else if (ew <= 3.55d-171) then
tmp = abs((sin(atan(((eh / cos(t)) * (-t / ew)))) * (-sin(t) * eh)))
else if (ew <= 2.6d-90) then
tmp = t_2 / sqrt((1.0d0 + (t_1 ** 2.0d0)))
else
tmp = t_3
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = (Math.tan(t) / ew) * eh;
double t_2 = ((eh * Math.sin(t)) * t_1) + (Math.cos(t) * ew);
double t_3 = Math.abs((t_2 / (-1.0 / Math.cos(Math.atan(t_1)))));
double tmp;
if (ew <= -3.8e-64) {
tmp = t_3;
} else if (ew <= 3.55e-171) {
tmp = Math.abs((Math.sin(Math.atan(((eh / Math.cos(t)) * (-t / ew)))) * (-Math.sin(t) * eh)));
} else if (ew <= 2.6e-90) {
tmp = t_2 / Math.sqrt((1.0 + Math.pow(t_1, 2.0)));
} else {
tmp = t_3;
}
return tmp;
}
def code(eh, ew, t): t_1 = (math.tan(t) / ew) * eh t_2 = ((eh * math.sin(t)) * t_1) + (math.cos(t) * ew) t_3 = math.fabs((t_2 / (-1.0 / math.cos(math.atan(t_1))))) tmp = 0 if ew <= -3.8e-64: tmp = t_3 elif ew <= 3.55e-171: tmp = math.fabs((math.sin(math.atan(((eh / math.cos(t)) * (-t / ew)))) * (-math.sin(t) * eh))) elif ew <= 2.6e-90: tmp = t_2 / math.sqrt((1.0 + math.pow(t_1, 2.0))) else: tmp = t_3 return tmp
function code(eh, ew, t) t_1 = Float64(Float64(tan(t) / ew) * eh) t_2 = Float64(Float64(Float64(eh * sin(t)) * t_1) + Float64(cos(t) * ew)) t_3 = abs(Float64(t_2 / Float64(-1.0 / cos(atan(t_1))))) tmp = 0.0 if (ew <= -3.8e-64) tmp = t_3; elseif (ew <= 3.55e-171) tmp = abs(Float64(sin(atan(Float64(Float64(eh / cos(t)) * Float64(Float64(-t) / ew)))) * Float64(Float64(-sin(t)) * eh))); elseif (ew <= 2.6e-90) tmp = Float64(t_2 / sqrt(Float64(1.0 + (t_1 ^ 2.0)))); else tmp = t_3; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = (tan(t) / ew) * eh; t_2 = ((eh * sin(t)) * t_1) + (cos(t) * ew); t_3 = abs((t_2 / (-1.0 / cos(atan(t_1))))); tmp = 0.0; if (ew <= -3.8e-64) tmp = t_3; elseif (ew <= 3.55e-171) tmp = abs((sin(atan(((eh / cos(t)) * (-t / ew)))) * (-sin(t) * eh))); elseif (ew <= 2.6e-90) tmp = t_2 / sqrt((1.0 + (t_1 ^ 2.0))); else tmp = t_3; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(t$95$2 / N[(-1.0 / N[Cos[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -3.8e-64], t$95$3, If[LessEqual[ew, 3.55e-171], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[((-t) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 2.6e-90], N[(t$95$2 / N[Sqrt[N[(1.0 + N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\tan t}{ew} \cdot eh\\
t_2 := \left(eh \cdot \sin t\right) \cdot t\_1 + \cos t \cdot ew\\
t_3 := \left|\frac{t\_2}{\frac{-1}{\cos \tan^{-1} t\_1}}\right|\\
\mathbf{if}\;ew \leq -3.8 \cdot 10^{-64}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;ew \leq 3.55 \cdot 10^{-171}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{\cos t} \cdot \frac{-t}{ew}\right) \cdot \left(\left(-\sin t\right) \cdot eh\right)\right|\\
\mathbf{elif}\;ew \leq 2.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{t\_2}{\sqrt{1 + {t\_1}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if ew < -3.8000000000000002e-64 or 2.6e-90 < ew Initial program 99.8%
Applied rewrites83.6%
if -3.8000000000000002e-64 < ew < 3.54999999999999999e-171Initial program 99.8%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites76.9%
Taylor expanded in t around 0
Applied rewrites77.0%
if 3.54999999999999999e-171 < ew < 2.6e-90Initial program 100.0%
Applied rewrites100.0%
Applied rewrites91.0%
Applied rewrites86.4%
Final simplification81.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) ew))
(t_2 (* (/ (tan t) ew) eh))
(t_3 (fabs (* t_1 (cos (atan t_2))))))
(if (<= ew -2.9e-58)
t_3
(if (<= ew 3.55e-171)
(fabs
(* (sin (atan (* (/ eh (cos t)) (/ (- t) ew)))) (* (- (sin t)) eh)))
(if (<= ew 2.6e-90)
(/ (+ (* (* eh (sin t)) t_2) t_1) (sqrt (+ 1.0 (pow t_2 2.0))))
t_3)))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * ew;
double t_2 = (tan(t) / ew) * eh;
double t_3 = fabs((t_1 * cos(atan(t_2))));
double tmp;
if (ew <= -2.9e-58) {
tmp = t_3;
} else if (ew <= 3.55e-171) {
tmp = fabs((sin(atan(((eh / cos(t)) * (-t / ew)))) * (-sin(t) * eh)));
} else if (ew <= 2.6e-90) {
tmp = (((eh * sin(t)) * t_2) + t_1) / sqrt((1.0 + pow(t_2, 2.0)));
} else {
tmp = t_3;
}
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) :: tmp
t_1 = cos(t) * ew
t_2 = (tan(t) / ew) * eh
t_3 = abs((t_1 * cos(atan(t_2))))
if (ew <= (-2.9d-58)) then
tmp = t_3
else if (ew <= 3.55d-171) then
tmp = abs((sin(atan(((eh / cos(t)) * (-t / ew)))) * (-sin(t) * eh)))
else if (ew <= 2.6d-90) then
tmp = (((eh * sin(t)) * t_2) + t_1) / sqrt((1.0d0 + (t_2 ** 2.0d0)))
else
tmp = t_3
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.cos(t) * ew;
double t_2 = (Math.tan(t) / ew) * eh;
double t_3 = Math.abs((t_1 * Math.cos(Math.atan(t_2))));
double tmp;
if (ew <= -2.9e-58) {
tmp = t_3;
} else if (ew <= 3.55e-171) {
tmp = Math.abs((Math.sin(Math.atan(((eh / Math.cos(t)) * (-t / ew)))) * (-Math.sin(t) * eh)));
} else if (ew <= 2.6e-90) {
tmp = (((eh * Math.sin(t)) * t_2) + t_1) / Math.sqrt((1.0 + Math.pow(t_2, 2.0)));
} else {
tmp = t_3;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.cos(t) * ew t_2 = (math.tan(t) / ew) * eh t_3 = math.fabs((t_1 * math.cos(math.atan(t_2)))) tmp = 0 if ew <= -2.9e-58: tmp = t_3 elif ew <= 3.55e-171: tmp = math.fabs((math.sin(math.atan(((eh / math.cos(t)) * (-t / ew)))) * (-math.sin(t) * eh))) elif ew <= 2.6e-90: tmp = (((eh * math.sin(t)) * t_2) + t_1) / math.sqrt((1.0 + math.pow(t_2, 2.0))) else: tmp = t_3 return tmp
function code(eh, ew, t) t_1 = Float64(cos(t) * ew) t_2 = Float64(Float64(tan(t) / ew) * eh) t_3 = abs(Float64(t_1 * cos(atan(t_2)))) tmp = 0.0 if (ew <= -2.9e-58) tmp = t_3; elseif (ew <= 3.55e-171) tmp = abs(Float64(sin(atan(Float64(Float64(eh / cos(t)) * Float64(Float64(-t) / ew)))) * Float64(Float64(-sin(t)) * eh))); elseif (ew <= 2.6e-90) tmp = Float64(Float64(Float64(Float64(eh * sin(t)) * t_2) + t_1) / sqrt(Float64(1.0 + (t_2 ^ 2.0)))); else tmp = t_3; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = cos(t) * ew; t_2 = (tan(t) / ew) * eh; t_3 = abs((t_1 * cos(atan(t_2)))); tmp = 0.0; if (ew <= -2.9e-58) tmp = t_3; elseif (ew <= 3.55e-171) tmp = abs((sin(atan(((eh / cos(t)) * (-t / ew)))) * (-sin(t) * eh))); elseif (ew <= 2.6e-90) tmp = (((eh * sin(t)) * t_2) + t_1) / sqrt((1.0 + (t_2 ^ 2.0))); else tmp = t_3; 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[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(t$95$1 * N[Cos[N[ArcTan[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.9e-58], t$95$3, If[LessEqual[ew, 3.55e-171], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[((-t) / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 2.6e-90], N[(N[(N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot ew\\
t_2 := \frac{\tan t}{ew} \cdot eh\\
t_3 := \left|t\_1 \cdot \cos \tan^{-1} t\_2\right|\\
\mathbf{if}\;ew \leq -2.9 \cdot 10^{-58}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;ew \leq 3.55 \cdot 10^{-171}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{\cos t} \cdot \frac{-t}{ew}\right) \cdot \left(\left(-\sin t\right) \cdot eh\right)\right|\\
\mathbf{elif}\;ew \leq 2.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{\left(eh \cdot \sin t\right) \cdot t\_2 + t\_1}{\sqrt{1 + {t\_2}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if ew < -2.8999999999999999e-58 or 2.6e-90 < ew Initial program 99.8%
Applied rewrites99.6%
Taylor expanded in eh around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.2%
Applied rewrites83.3%
if -2.8999999999999999e-58 < ew < 3.54999999999999999e-171Initial program 99.8%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites76.3%
Taylor expanded in t around 0
Applied rewrites76.4%
if 3.54999999999999999e-171 < ew < 2.6e-90Initial program 100.0%
Applied rewrites100.0%
Applied rewrites91.0%
Applied rewrites86.4%
Final simplification81.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin (atan (* (/ (- eh) ew) t))) (* (- (sin t)) eh)))))
(if (<= eh -2.6e+67)
t_1
(if (<= eh 5.5e+131)
(fabs (* (* (cos t) ew) (cos (atan (* (/ (tan t) ew) eh)))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(atan(((-eh / ew) * t))) * (-sin(t) * eh)));
double tmp;
if (eh <= -2.6e+67) {
tmp = t_1;
} else if (eh <= 5.5e+131) {
tmp = fabs(((cos(t) * ew) * cos(atan(((tan(t) / ew) * eh)))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = abs((sin(atan(((-eh / ew) * t))) * (-sin(t) * eh)))
if (eh <= (-2.6d+67)) then
tmp = t_1
else if (eh <= 5.5d+131) then
tmp = abs(((cos(t) * ew) * cos(atan(((tan(t) / ew) * eh)))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((Math.sin(Math.atan(((-eh / ew) * t))) * (-Math.sin(t) * eh)));
double tmp;
if (eh <= -2.6e+67) {
tmp = t_1;
} else if (eh <= 5.5e+131) {
tmp = Math.abs(((Math.cos(t) * ew) * Math.cos(Math.atan(((Math.tan(t) / ew) * eh)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(math.atan(((-eh / ew) * t))) * (-math.sin(t) * eh))) tmp = 0 if eh <= -2.6e+67: tmp = t_1 elif eh <= 5.5e+131: tmp = math.fabs(((math.cos(t) * ew) * math.cos(math.atan(((math.tan(t) / ew) * eh))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(atan(Float64(Float64(Float64(-eh) / ew) * t))) * Float64(Float64(-sin(t)) * eh))) tmp = 0.0 if (eh <= -2.6e+67) tmp = t_1; elseif (eh <= 5.5e+131) tmp = abs(Float64(Float64(cos(t) * ew) * cos(atan(Float64(Float64(tan(t) / ew) * eh))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(atan(((-eh / ew) * t))) * (-sin(t) * eh))); tmp = 0.0; if (eh <= -2.6e+67) tmp = t_1; elseif (eh <= 5.5e+131) tmp = abs(((cos(t) * ew) * cos(atan(((tan(t) / ew) * eh))))); 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[((-eh) / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.6e+67], t$95$1, If[LessEqual[eh, 5.5e+131], N[Abs[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], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin \tan^{-1} \left(\frac{-eh}{ew} \cdot t\right) \cdot \left(\left(-\sin t\right) \cdot eh\right)\right|\\
\mathbf{if}\;eh \leq -2.6 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 5.5 \cdot 10^{+131}:\\
\;\;\;\;\left|\left(\cos t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -2.6e67 or 5.49999999999999971e131 < eh Initial program 99.8%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites75.7%
Taylor expanded in t around 0
Applied rewrites75.9%
if -2.6e67 < eh < 5.49999999999999971e131Initial program 99.8%
Applied rewrites99.6%
Taylor expanded in eh around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.8%
Applied rewrites81.0%
Final simplification79.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin (atan (* (/ (- eh) ew) t))) (* (- (sin t)) eh)))))
(if (<= eh -8.2e+64)
t_1
(if (<= eh 5.5e+131)
(/
1.0
(fabs
(/
1.0
(*
(/ 1.0 (sqrt (+ 1.0 (pow (* (/ (tan t) ew) eh) 2.0))))
(* (cos t) ew)))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(atan(((-eh / ew) * t))) * (-sin(t) * eh)));
double tmp;
if (eh <= -8.2e+64) {
tmp = t_1;
} else if (eh <= 5.5e+131) {
tmp = 1.0 / fabs((1.0 / ((1.0 / sqrt((1.0 + pow(((tan(t) / ew) * eh), 2.0)))) * (cos(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(((-eh / ew) * t))) * (-sin(t) * eh)))
if (eh <= (-8.2d+64)) then
tmp = t_1
else if (eh <= 5.5d+131) then
tmp = 1.0d0 / abs((1.0d0 / ((1.0d0 / sqrt((1.0d0 + (((tan(t) / ew) * eh) ** 2.0d0)))) * (cos(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(((-eh / ew) * t))) * (-Math.sin(t) * eh)));
double tmp;
if (eh <= -8.2e+64) {
tmp = t_1;
} else if (eh <= 5.5e+131) {
tmp = 1.0 / Math.abs((1.0 / ((1.0 / Math.sqrt((1.0 + Math.pow(((Math.tan(t) / ew) * eh), 2.0)))) * (Math.cos(t) * ew))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(math.atan(((-eh / ew) * t))) * (-math.sin(t) * eh))) tmp = 0 if eh <= -8.2e+64: tmp = t_1 elif eh <= 5.5e+131: tmp = 1.0 / math.fabs((1.0 / ((1.0 / math.sqrt((1.0 + math.pow(((math.tan(t) / ew) * eh), 2.0)))) * (math.cos(t) * ew)))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(atan(Float64(Float64(Float64(-eh) / ew) * t))) * Float64(Float64(-sin(t)) * eh))) tmp = 0.0 if (eh <= -8.2e+64) tmp = t_1; elseif (eh <= 5.5e+131) tmp = Float64(1.0 / abs(Float64(1.0 / Float64(Float64(1.0 / sqrt(Float64(1.0 + (Float64(Float64(tan(t) / ew) * eh) ^ 2.0)))) * Float64(cos(t) * ew))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(atan(((-eh / ew) * t))) * (-sin(t) * eh))); tmp = 0.0; if (eh <= -8.2e+64) tmp = t_1; elseif (eh <= 5.5e+131) tmp = 1.0 / abs((1.0 / ((1.0 / sqrt((1.0 + (((tan(t) / ew) * eh) ^ 2.0)))) * (cos(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[((-eh) / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -8.2e+64], t$95$1, If[LessEqual[eh, 5.5e+131], N[(1.0 / N[Abs[N[(1.0 / N[(N[(1.0 / N[Sqrt[N[(1.0 + N[Power[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $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|\sin \tan^{-1} \left(\frac{-eh}{ew} \cdot t\right) \cdot \left(\left(-\sin t\right) \cdot eh\right)\right|\\
\mathbf{if}\;eh \leq -8.2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 5.5 \cdot 10^{+131}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{\frac{1}{\sqrt{1 + {\left(\frac{\tan t}{ew} \cdot eh\right)}^{2}}} \cdot \left(\cos t \cdot ew\right)}\right|}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -8.19999999999999956e64 or 5.49999999999999971e131 < eh Initial program 99.8%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites75.7%
Taylor expanded in t around 0
Applied rewrites75.9%
if -8.19999999999999956e64 < eh < 5.49999999999999971e131Initial program 99.8%
Applied rewrites99.6%
Taylor expanded in eh around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.8%
Applied rewrites80.7%
Final simplification79.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (- (sin t)) eh)))
(if (<= eh -5.4e+64)
(fabs (* (sin (atan (* (/ (- eh) ew) t))) t_1))
(if (<= eh 1.42e+97)
(/ 1.0 (fabs (/ 1.0 (* (cos (atan (* (/ t ew) eh))) (* (cos t) ew)))))
(fabs
(*
(sin
(atan (* (/ (fma -0.3333333333333333 (* (* eh t) t) (- eh)) ew) t)))
t_1))))))
double code(double eh, double ew, double t) {
double t_1 = -sin(t) * eh;
double tmp;
if (eh <= -5.4e+64) {
tmp = fabs((sin(atan(((-eh / ew) * t))) * t_1));
} else if (eh <= 1.42e+97) {
tmp = 1.0 / fabs((1.0 / (cos(atan(((t / ew) * eh))) * (cos(t) * ew))));
} else {
tmp = fabs((sin(atan(((fma(-0.3333333333333333, ((eh * t) * t), -eh) / ew) * t))) * t_1));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(Float64(-sin(t)) * eh) tmp = 0.0 if (eh <= -5.4e+64) tmp = abs(Float64(sin(atan(Float64(Float64(Float64(-eh) / ew) * t))) * t_1)); elseif (eh <= 1.42e+97) tmp = Float64(1.0 / abs(Float64(1.0 / Float64(cos(atan(Float64(Float64(t / ew) * eh))) * Float64(cos(t) * ew))))); else tmp = abs(Float64(sin(atan(Float64(Float64(fma(-0.3333333333333333, Float64(Float64(eh * t) * t), Float64(-eh)) / ew) * t))) * t_1)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision]}, If[LessEqual[eh, -5.4e+64], N[Abs[N[(N[Sin[N[ArcTan[N[(N[((-eh) / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[eh, 1.42e+97], N[(1.0 / N[Abs[N[(1.0 / N[(N[Cos[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(-0.3333333333333333 * N[(N[(eh * t), $MachinePrecision] * t), $MachinePrecision] + (-eh)), $MachinePrecision] / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\sin t\right) \cdot eh\\
\mathbf{if}\;eh \leq -5.4 \cdot 10^{+64}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{-eh}{ew} \cdot t\right) \cdot t\_1\right|\\
\mathbf{elif}\;eh \leq 1.42 \cdot 10^{+97}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{\cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right) \cdot \left(\cos t \cdot ew\right)}\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \left(eh \cdot t\right) \cdot t, -eh\right)}{ew} \cdot t\right) \cdot t\_1\right|\\
\end{array}
\end{array}
if eh < -5.3999999999999999e64Initial program 99.9%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites73.2%
Taylor expanded in t around 0
Applied rewrites73.4%
if -5.3999999999999999e64 < eh < 1.41999999999999991e97Initial program 99.8%
Applied rewrites99.6%
Taylor expanded in eh around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites81.4%
Taylor expanded in t around 0
Applied rewrites72.7%
if 1.41999999999999991e97 < eh Initial program 99.7%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites74.8%
Taylor expanded in t around 0
Applied rewrites75.0%
Taylor expanded in t around 0
Applied rewrites75.0%
Final simplification73.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(*
(sin
(atan
(* (/ (fma -0.3333333333333333 (* (* eh t) t) (- eh)) ew) t)))
(* (- (sin t)) eh)))))
(if (<= t -7.8e-22) t_1 (if (<= t 4.8e-83) (fabs (/ ew 1.0)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(atan(((fma(-0.3333333333333333, ((eh * t) * t), -eh) / ew) * t))) * (-sin(t) * eh)));
double tmp;
if (t <= -7.8e-22) {
tmp = t_1;
} else if (t <= 4.8e-83) {
tmp = fabs((ew / 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(Float64(sin(atan(Float64(Float64(fma(-0.3333333333333333, Float64(Float64(eh * t) * t), Float64(-eh)) / ew) * t))) * Float64(Float64(-sin(t)) * eh))) tmp = 0.0 if (t <= -7.8e-22) tmp = t_1; elseif (t <= 4.8e-83) tmp = abs(Float64(ew / 1.0)); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(-0.3333333333333333 * N[(N[(eh * t), $MachinePrecision] * t), $MachinePrecision] + (-eh)), $MachinePrecision] / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7.8e-22], t$95$1, If[LessEqual[t, 4.8e-83], N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \left(eh \cdot t\right) \cdot t, -eh\right)}{ew} \cdot t\right) \cdot \left(\left(-\sin t\right) \cdot eh\right)\right|\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-83}:\\
\;\;\;\;\left|\frac{ew}{1}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.79999999999999996e-22 or 4.8000000000000002e-83 < t Initial program 99.7%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites53.2%
Taylor expanded in t around 0
Applied rewrites53.6%
Taylor expanded in t around 0
Applied rewrites53.6%
if -7.79999999999999996e-22 < t < 4.8000000000000002e-83Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.1%
Taylor expanded in t around 0
Applied rewrites79.1%
Applied rewrites78.8%
Taylor expanded in eh around 0
Applied rewrites79.1%
Final simplification64.9%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* (sin (atan (* (/ (- eh) ew) t))) (* (- (sin t)) eh))))) (if (<= t -7.8e-22) t_1 (if (<= t 4.8e-83) (fabs (/ ew 1.0)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(atan(((-eh / ew) * t))) * (-sin(t) * eh)));
double tmp;
if (t <= -7.8e-22) {
tmp = t_1;
} else if (t <= 4.8e-83) {
tmp = fabs((ew / 1.0));
} 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(((-eh / ew) * t))) * (-sin(t) * eh)))
if (t <= (-7.8d-22)) then
tmp = t_1
else if (t <= 4.8d-83) then
tmp = abs((ew / 1.0d0))
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(((-eh / ew) * t))) * (-Math.sin(t) * eh)));
double tmp;
if (t <= -7.8e-22) {
tmp = t_1;
} else if (t <= 4.8e-83) {
tmp = Math.abs((ew / 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(math.atan(((-eh / ew) * t))) * (-math.sin(t) * eh))) tmp = 0 if t <= -7.8e-22: tmp = t_1 elif t <= 4.8e-83: tmp = math.fabs((ew / 1.0)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(atan(Float64(Float64(Float64(-eh) / ew) * t))) * Float64(Float64(-sin(t)) * eh))) tmp = 0.0 if (t <= -7.8e-22) tmp = t_1; elseif (t <= 4.8e-83) tmp = abs(Float64(ew / 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(atan(((-eh / ew) * t))) * (-sin(t) * eh))); tmp = 0.0; if (t <= -7.8e-22) tmp = t_1; elseif (t <= 4.8e-83) tmp = abs((ew / 1.0)); 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[((-eh) / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[((-N[Sin[t], $MachinePrecision]) * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7.8e-22], t$95$1, If[LessEqual[t, 4.8e-83], N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin \tan^{-1} \left(\frac{-eh}{ew} \cdot t\right) \cdot \left(\left(-\sin t\right) \cdot eh\right)\right|\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-83}:\\
\;\;\;\;\left|\frac{ew}{1}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.79999999999999996e-22 or 4.8000000000000002e-83 < t Initial program 99.7%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites53.2%
Taylor expanded in t around 0
Applied rewrites53.5%
if -7.79999999999999996e-22 < t < 4.8000000000000002e-83Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.1%
Taylor expanded in t around 0
Applied rewrites79.1%
Applied rewrites78.8%
Taylor expanded in eh around 0
Applied rewrites79.1%
Final simplification64.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(*
(* (- t) eh)
(sin
(atan
(* (/ (fma -0.3333333333333333 (* (* eh t) t) (- eh)) ew) t)))))))
(if (<= eh -3.4e+137) t_1 (if (<= eh 3.5e+98) (fabs (/ ew 1.0)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs(((-t * eh) * sin(atan(((fma(-0.3333333333333333, ((eh * t) * t), -eh) / ew) * t)))));
double tmp;
if (eh <= -3.4e+137) {
tmp = t_1;
} else if (eh <= 3.5e+98) {
tmp = fabs((ew / 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(Float64(Float64(Float64(-t) * eh) * sin(atan(Float64(Float64(fma(-0.3333333333333333, Float64(Float64(eh * t) * t), Float64(-eh)) / ew) * t))))) tmp = 0.0 if (eh <= -3.4e+137) tmp = t_1; elseif (eh <= 3.5e+98) tmp = abs(Float64(ew / 1.0)); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[((-t) * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[(-0.3333333333333333 * N[(N[(eh * t), $MachinePrecision] * t), $MachinePrecision] + (-eh)), $MachinePrecision] / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -3.4e+137], t$95$1, If[LessEqual[eh, 3.5e+98], N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\left(\left(-t\right) \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{\mathsf{fma}\left(-0.3333333333333333, \left(eh \cdot t\right) \cdot t, -eh\right)}{ew} \cdot t\right)\right|\\
\mathbf{if}\;eh \leq -3.4 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 3.5 \cdot 10^{+98}:\\
\;\;\;\;\left|\frac{ew}{1}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -3.39999999999999986e137 or 3.5e98 < eh Initial program 99.8%
Taylor expanded in eh around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
Applied rewrites77.2%
Taylor expanded in t around 0
Applied rewrites77.4%
Taylor expanded in t around 0
Applied rewrites77.4%
Taylor expanded in t around 0
Applied rewrites38.2%
if -3.39999999999999986e137 < eh < 3.5e98Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites53.8%
Taylor expanded in t around 0
Applied rewrites52.7%
Applied rewrites52.1%
Taylor expanded in eh around 0
Applied rewrites54.0%
Final simplification49.1%
(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 rewrites43.5%
Taylor expanded in t around 0
Applied rewrites42.5%
Applied rewrites41.7%
Taylor expanded in eh around 0
Applied rewrites43.6%
herbie shell --seed 2024283
(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)))))))