
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((eh / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((eh / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ eh (* (tan t) ew))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh / (tan(t) * ew)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan((eh / (tan(t) * ew)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan((eh / (Math.tan(t) * ew)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan((eh / (math.tan(t) * ew))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(eh / Float64(tan(t) * ew))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan((eh / (tan(t) * ew))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (/ eh ew) (tan t))))
(t_2 (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1)))))
(if (<= t_2 -5e-79)
(* (sin (pow (- t) 1.0)) ew)
(if (<= t_2 5e+35)
(fabs
(*
(sin
(atan
(/ (fma (* (/ eh ew) -0.3333333333333333) (* t t) (/ eh ew)) t)))
eh))
(if (or (<= t_2 4e+185) (not (<= t_2 5e+218)))
(* (tanh (asinh (/ (/ eh (tan t)) ew))) eh)
(* (sin t) ew))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
double t_2 = ((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1));
double tmp;
if (t_2 <= -5e-79) {
tmp = sin(pow(-t, 1.0)) * ew;
} else if (t_2 <= 5e+35) {
tmp = fabs((sin(atan((fma(((eh / ew) * -0.3333333333333333), (t * t), (eh / ew)) / t))) * eh));
} else if ((t_2 <= 4e+185) || !(t_2 <= 5e+218)) {
tmp = tanh(asinh(((eh / tan(t)) / ew))) * eh;
} else {
tmp = sin(t) * ew;
}
return tmp;
}
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) t_2 = Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))) tmp = 0.0 if (t_2 <= -5e-79) tmp = Float64(sin((Float64(-t) ^ 1.0)) * ew); elseif (t_2 <= 5e+35) tmp = abs(Float64(sin(atan(Float64(fma(Float64(Float64(eh / ew) * -0.3333333333333333), Float64(t * t), Float64(eh / ew)) / t))) * eh)); elseif ((t_2 <= 4e+185) || !(t_2 <= 5e+218)) tmp = Float64(tanh(asinh(Float64(Float64(eh / tan(t)) / ew))) * eh); else tmp = Float64(sin(t) * ew); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-79], N[(N[Sin[N[Power[(-t), 1.0], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision], If[LessEqual[t$95$2, 5e+35], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(N[(eh / ew), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[t$95$2, 4e+185], N[Not[LessEqual[t$95$2, 5e+218]], $MachinePrecision]], N[(N[Tanh[N[ArcSinh[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision], N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
t_2 := \left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-79}:\\
\;\;\;\;\sin \left({\left(-t\right)}^{1}\right) \cdot ew\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+35}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{eh}{ew} \cdot -0.3333333333333333, t \cdot t, \frac{eh}{ew}\right)}{t}\right) \cdot eh\right|\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+185} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+218}\right):\\
\;\;\;\;\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\\
\mathbf{else}:\\
\;\;\;\;\sin t \cdot ew\\
\end{array}
\end{array}
if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -4.99999999999999999e-79Initial program 99.8%
Applied rewrites0.6%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f641.2
Applied rewrites1.2%
Applied rewrites41.7%
if -4.99999999999999999e-79 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < 5.00000000000000021e35Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6449.4
Applied rewrites49.4%
Taylor expanded in t around 0
Applied rewrites49.6%
if 5.00000000000000021e35 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < 3.9999999999999999e185 or 4.99999999999999983e218 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6453.8
Applied rewrites53.8%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
rem-square-sqrt51.2
Applied rewrites51.2%
if 3.9999999999999999e185 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < 4.99999999999999983e218Initial program 99.7%
Applied rewrites91.4%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6484.1
Applied rewrites84.1%
Final simplification49.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
(if (<=
(+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1)))
-1e-227)
(* (sin (pow (- t) 1.0)) ew)
(* (sin t) ew))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
double tmp;
if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= -1e-227) {
tmp = sin(pow(-t, 1.0)) * ew;
} else {
tmp = sin(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 / ew) / tan(t)))
if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= (-1d-227)) then
tmp = sin((-t ** 1.0d0)) * ew
else
tmp = sin(t) * ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
double tmp;
if ((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))) <= -1e-227) {
tmp = Math.sin(Math.pow(-t, 1.0)) * ew;
} else {
tmp = Math.sin(t) * ew;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) tmp = 0 if (((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))) <= -1e-227: tmp = math.sin(math.pow(-t, 1.0)) * ew else: tmp = math.sin(t) * ew return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) tmp = 0.0 if (Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))) <= -1e-227) tmp = Float64(sin((Float64(-t) ^ 1.0)) * ew); else tmp = Float64(sin(t) * ew); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = 0.0; if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= -1e-227) tmp = sin((-t ^ 1.0)) * ew; else tmp = sin(t) * ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-227], N[(N[Sin[N[Power[(-t), 1.0], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision], N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1 \leq -1 \cdot 10^{-227}:\\
\;\;\;\;\sin \left({\left(-t\right)}^{1}\right) \cdot ew\\
\mathbf{else}:\\
\;\;\;\;\sin t \cdot ew\\
\end{array}
\end{array}
if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -9.99999999999999945e-228Initial program 99.8%
Applied rewrites0.9%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f641.6
Applied rewrites1.6%
Applied rewrites40.3%
if -9.99999999999999945e-228 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) Initial program 99.8%
Applied rewrites59.6%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6435.8
Applied rewrites35.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
(if (<=
(+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1)))
-1e-227)
(* (sin (fabs t)) ew)
(* (sin t) ew))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
double tmp;
if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= -1e-227) {
tmp = sin(fabs(t)) * ew;
} else {
tmp = sin(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 / ew) / tan(t)))
if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= (-1d-227)) then
tmp = sin(abs(t)) * ew
else
tmp = sin(t) * ew
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
double tmp;
if ((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))) <= -1e-227) {
tmp = Math.sin(Math.abs(t)) * ew;
} else {
tmp = Math.sin(t) * ew;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) tmp = 0 if (((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))) <= -1e-227: tmp = math.sin(math.fabs(t)) * ew else: tmp = math.sin(t) * ew return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) tmp = 0.0 if (Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))) <= -1e-227) tmp = Float64(sin(abs(t)) * ew); else tmp = Float64(sin(t) * ew); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = 0.0; if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= -1e-227) tmp = sin(abs(t)) * ew; else tmp = sin(t) * ew; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-227], N[(N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision], N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1 \leq -1 \cdot 10^{-227}:\\
\;\;\;\;\sin \left(\left|t\right|\right) \cdot ew\\
\mathbf{else}:\\
\;\;\;\;\sin t \cdot ew\\
\end{array}
\end{array}
if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -9.99999999999999945e-228Initial program 99.8%
Applied rewrites0.9%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f641.6
Applied rewrites1.6%
Applied rewrites22.6%
if -9.99999999999999945e-228 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) Initial program 99.8%
Applied rewrites59.6%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6435.8
Applied rewrites35.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
(if (<=
(+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1)))
-1e-227)
(* (* (fma -0.16666666666666666 (* t t) 1.0) (fabs t)) ew)
(* (sin t) ew))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
double tmp;
if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= -1e-227) {
tmp = (fma(-0.16666666666666666, (t * t), 1.0) * fabs(t)) * ew;
} else {
tmp = sin(t) * ew;
}
return tmp;
}
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) tmp = 0.0 if (Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))) <= -1e-227) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(t * t), 1.0) * abs(t)) * ew); else tmp = Float64(sin(t) * ew); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-227], N[(N[(N[(-0.16666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision], N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1 \leq -1 \cdot 10^{-227}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, t \cdot t, 1\right) \cdot \left|t\right|\right) \cdot ew\\
\mathbf{else}:\\
\;\;\;\;\sin t \cdot ew\\
\end{array}
\end{array}
if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -9.99999999999999945e-228Initial program 99.8%
Applied rewrites0.9%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f641.6
Applied rewrites1.6%
Taylor expanded in t around 0
Applied rewrites2.0%
Applied rewrites7.8%
if -9.99999999999999945e-228 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) Initial program 99.8%
Applied rewrites59.6%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6435.8
Applied rewrites35.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (/ eh ew) (tan t)))))
(if (<=
(+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1)))
5e-237)
(* (* (fma -0.16666666666666666 (* t t) 1.0) (fabs t)) ew)
(*
(*
(fma
(- (* 0.008333333333333333 (* t t)) 0.16666666666666666)
(* t t)
1.0)
t)
ew))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
double tmp;
if ((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))) <= 5e-237) {
tmp = (fma(-0.16666666666666666, (t * t), 1.0) * fabs(t)) * ew;
} else {
tmp = (fma(((0.008333333333333333 * (t * t)) - 0.16666666666666666), (t * t), 1.0) * t) * ew;
}
return tmp;
}
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) tmp = 0.0 if (Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1))) <= 5e-237) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(t * t), 1.0) * abs(t)) * ew); else tmp = Float64(Float64(fma(Float64(Float64(0.008333333333333333 * Float64(t * t)) - 0.16666666666666666), Float64(t * t), 1.0) * t) * ew); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-237], N[(N[(N[(-0.16666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision], N[(N[(N[(N[(N[(0.008333333333333333 * N[(t * t), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * t), $MachinePrecision] * ew), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1 \leq 5 \cdot 10^{-237}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, t \cdot t, 1\right) \cdot \left|t\right|\right) \cdot ew\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(0.008333333333333333 \cdot \left(t \cdot t\right) - 0.16666666666666666, t \cdot t, 1\right) \cdot t\right) \cdot ew\\
\end{array}
\end{array}
if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < 5.0000000000000002e-237Initial program 99.8%
Applied rewrites4.4%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f643.5
Applied rewrites3.5%
Taylor expanded in t around 0
Applied rewrites2.2%
Applied rewrites7.8%
if 5.0000000000000002e-237 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) Initial program 99.9%
Applied rewrites59.0%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6435.5
Applied rewrites35.5%
Taylor expanded in t around 0
Applied rewrites14.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fma -0.16666666666666666 (* t t) 1.0))
(t_2 (atan (/ (/ eh ew) (tan t)))))
(if (<=
(+ (* (* ew (sin t)) (cos t_2)) (* (* eh (cos t)) (sin t_2)))
-1e-290)
(* (* t_1 (fabs t)) ew)
(* (* t_1 t) ew))))
double code(double eh, double ew, double t) {
double t_1 = fma(-0.16666666666666666, (t * t), 1.0);
double t_2 = atan(((eh / ew) / tan(t)));
double tmp;
if ((((ew * sin(t)) * cos(t_2)) + ((eh * cos(t)) * sin(t_2))) <= -1e-290) {
tmp = (t_1 * fabs(t)) * ew;
} else {
tmp = (t_1 * t) * ew;
}
return tmp;
}
function code(eh, ew, t) t_1 = fma(-0.16666666666666666, Float64(t * t), 1.0) t_2 = atan(Float64(Float64(eh / ew) / tan(t))) tmp = 0.0 if (Float64(Float64(Float64(ew * sin(t)) * cos(t_2)) + Float64(Float64(eh * cos(t)) * sin(t_2))) <= -1e-290) tmp = Float64(Float64(t_1 * abs(t)) * ew); else tmp = Float64(Float64(t_1 * t) * ew); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(-0.16666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-290], N[(N[(t$95$1 * N[Abs[t], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision], N[(N[(t$95$1 * t), $MachinePrecision] * ew), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-0.16666666666666666, t \cdot t, 1\right)\\
t_2 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\mathbf{if}\;\left(ew \cdot \sin t\right) \cdot \cos t\_2 + \left(eh \cdot \cos t\right) \cdot \sin t\_2 \leq -1 \cdot 10^{-290}:\\
\;\;\;\;\left(t\_1 \cdot \left|t\right|\right) \cdot ew\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 \cdot t\right) \cdot ew\\
\end{array}
\end{array}
if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -1.0000000000000001e-290Initial program 99.8%
Applied rewrites0.9%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f641.6
Applied rewrites1.6%
Taylor expanded in t around 0
Applied rewrites2.1%
Applied rewrites7.8%
if -1.0000000000000001e-290 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) Initial program 99.8%
Applied rewrites59.9%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6436.0
Applied rewrites36.0%
Taylor expanded in t around 0
Applied rewrites14.2%
(FPCore (eh ew t)
:precision binary64
(fabs
(+
(*
(* eh (cos t))
(sin (atan (/ (/ (fma (* (* t t) eh) -0.3333333333333333 eh) ew) t))))
(* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan(((fma(((t * t) * eh), -0.3333333333333333, eh) / ew) / t)))) + ((ew * sin(t)) * cos(atan(((eh / ew) / tan(t)))))));
}
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(fma(Float64(Float64(t * t) * eh), -0.3333333333333333, eh) / ew) / t)))) + Float64(Float64(ew * sin(t)) * cos(atan(Float64(Float64(eh / ew) / tan(t))))))) end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(N[(N[(N[(t * t), $MachinePrecision] * eh), $MachinePrecision] * -0.3333333333333333 + eh), $MachinePrecision] / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{\mathsf{fma}\left(\left(t \cdot t\right) \cdot eh, -0.3333333333333333, eh\right)}{ew}}{t}\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites99.1%
Final simplification99.1%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* eh (cos t)) (sin (atan (/ eh (* (tan t) ew))))) (* (* ew (sin t)) (cos (atan (/ (/ eh ew) t)))))))
double code(double eh, double ew, double t) {
return fabs((((eh * cos(t)) * sin(atan((eh / (tan(t) * ew))))) + ((ew * sin(t)) * 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((((eh * cos(t)) * sin(atan((eh / (tan(t) * ew))))) + ((ew * sin(t)) * cos(atan(((eh / ew) / t))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((eh * Math.cos(t)) * Math.sin(Math.atan((eh / (Math.tan(t) * ew))))) + ((ew * Math.sin(t)) * Math.cos(Math.atan(((eh / ew) / t))))));
}
def code(eh, ew, t): return math.fabs((((eh * math.cos(t)) * math.sin(math.atan((eh / (math.tan(t) * ew))))) + ((ew * math.sin(t)) * math.cos(math.atan(((eh / ew) / t))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(eh * cos(t)) * sin(atan(Float64(eh / Float64(tan(t) * ew))))) + Float64(Float64(ew * sin(t)) * cos(atan(Float64(Float64(eh / ew) / t)))))) end
function tmp = code(eh, ew, t) tmp = abs((((eh * cos(t)) * sin(atan((eh / (tan(t) * ew))))) + ((ew * sin(t)) * cos(atan(((eh / ew) / t)))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{t}\right)\right|
\end{array}
Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.0
Applied rewrites99.0%
Final simplification99.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh (tan t)) ew)))
(if (or (<= t -1.38e-8) (not (<= t 1.2e-72)))
(fabs (/ (fma (* t_1 eh) (cos t) (* (sin t) ew)) (cosh (asinh t_1))))
(fabs (* (sin (atan (* (/ (cos t) ew) (/ eh t)))) eh)))))
double code(double eh, double ew, double t) {
double t_1 = (eh / tan(t)) / ew;
double tmp;
if ((t <= -1.38e-8) || !(t <= 1.2e-72)) {
tmp = fabs((fma((t_1 * eh), cos(t), (sin(t) * ew)) / cosh(asinh(t_1))));
} else {
tmp = fabs((sin(atan(((cos(t) / ew) * (eh / t)))) * eh));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(Float64(eh / tan(t)) / ew) tmp = 0.0 if ((t <= -1.38e-8) || !(t <= 1.2e-72)) tmp = abs(Float64(fma(Float64(t_1 * eh), cos(t), Float64(sin(t) * ew)) / cosh(asinh(t_1)))); else tmp = abs(Float64(sin(atan(Float64(Float64(cos(t) / ew) * Float64(eh / t)))) * eh)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, If[Or[LessEqual[t, -1.38e-8], N[Not[LessEqual[t, 1.2e-72]], $MachinePrecision]], N[Abs[N[(N[(N[(t$95$1 * eh), $MachinePrecision] * N[Cos[t], $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Cos[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
\mathbf{if}\;t \leq -1.38 \cdot 10^{-8} \lor \neg \left(t \leq 1.2 \cdot 10^{-72}\right):\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \cos t, \sin t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{t}\right) \cdot eh\right|\\
\end{array}
\end{array}
if t < -1.37999999999999995e-8 or 1.2e-72 < t Initial program 99.7%
Applied rewrites42.8%
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-squareN/A
lower-fabs.f6475.5
Applied rewrites75.5%
if -1.37999999999999995e-8 < t < 1.2e-72Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6485.1
Applied rewrites85.1%
Taylor expanded in t around 0
Applied rewrites85.1%
Final simplification79.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh (tan t)) ew)))
(if (or (<= t -1.38e-8) (not (<= t 1.2e-72)))
(fabs (/ (fma (* (cos t) t_1) eh (* (sin t) ew)) (cosh (asinh t_1))))
(fabs (* (sin (atan (* (/ (cos t) ew) (/ eh t)))) eh)))))
double code(double eh, double ew, double t) {
double t_1 = (eh / tan(t)) / ew;
double tmp;
if ((t <= -1.38e-8) || !(t <= 1.2e-72)) {
tmp = fabs((fma((cos(t) * t_1), eh, (sin(t) * ew)) / cosh(asinh(t_1))));
} else {
tmp = fabs((sin(atan(((cos(t) / ew) * (eh / t)))) * eh));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(Float64(eh / tan(t)) / ew) tmp = 0.0 if ((t <= -1.38e-8) || !(t <= 1.2e-72)) tmp = abs(Float64(fma(Float64(cos(t) * t_1), eh, Float64(sin(t) * ew)) / cosh(asinh(t_1)))); else tmp = abs(Float64(sin(atan(Float64(Float64(cos(t) / ew) * Float64(eh / t)))) * eh)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, If[Or[LessEqual[t, -1.38e-8], N[Not[LessEqual[t, 1.2e-72]], $MachinePrecision]], N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * t$95$1), $MachinePrecision] * eh + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Cos[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
\mathbf{if}\;t \leq -1.38 \cdot 10^{-8} \lor \neg \left(t \leq 1.2 \cdot 10^{-72}\right):\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\cos t \cdot t\_1, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{t}\right) \cdot eh\right|\\
\end{array}
\end{array}
if t < -1.37999999999999995e-8 or 1.2e-72 < t Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites75.5%
if -1.37999999999999995e-8 < t < 1.2e-72Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6485.1
Applied rewrites85.1%
Taylor expanded in t around 0
Applied rewrites85.1%
Final simplification79.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh (tan t)) ew)))
(if (or (<= t -1.04e-7) (not (<= t 1e-10)))
(/
(fabs (fma (* t_1 eh) (cos t) (* (sin t) ew)))
(sqrt (+ (pow t_1 2.0) 1.0)))
(fabs (* (sin (atan (* (/ (cos t) ew) (/ eh t)))) eh)))))
double code(double eh, double ew, double t) {
double t_1 = (eh / tan(t)) / ew;
double tmp;
if ((t <= -1.04e-7) || !(t <= 1e-10)) {
tmp = fabs(fma((t_1 * eh), cos(t), (sin(t) * ew))) / sqrt((pow(t_1, 2.0) + 1.0));
} else {
tmp = fabs((sin(atan(((cos(t) / ew) * (eh / t)))) * eh));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(Float64(eh / tan(t)) / ew) tmp = 0.0 if ((t <= -1.04e-7) || !(t <= 1e-10)) tmp = Float64(abs(fma(Float64(t_1 * eh), cos(t), Float64(sin(t) * ew))) / sqrt(Float64((t_1 ^ 2.0) + 1.0))); else tmp = abs(Float64(sin(atan(Float64(Float64(cos(t) / ew) * Float64(eh / t)))) * eh)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, If[Or[LessEqual[t, -1.04e-7], N[Not[LessEqual[t, 1e-10]], $MachinePrecision]], N[(N[Abs[N[(N[(t$95$1 * eh), $MachinePrecision] * N[Cos[t], $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[t$95$1, 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[Cos[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
\mathbf{if}\;t \leq -1.04 \cdot 10^{-7} \lor \neg \left(t \leq 10^{-10}\right):\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(t\_1 \cdot eh, \cos t, \sin t \cdot ew\right)\right|}{\sqrt{{t\_1}^{2} + 1}}\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\cos t}{ew} \cdot \frac{eh}{t}\right) \cdot eh\right|\\
\end{array}
\end{array}
if t < -1.04e-7 or 1.00000000000000004e-10 < t Initial program 99.7%
Applied rewrites41.1%
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-squareN/A
lower-fabs.f6475.7
Applied rewrites75.7%
lift-pow.f64N/A
lift-sqrt.f64N/A
sqrt-pow2N/A
metadata-evalN/A
unpow176.0
lift-fabs.f64N/A
lift-/.f64N/A
fabs-divN/A
Applied rewrites76.0%
lift-cosh.f64N/A
lift-asinh.f64N/A
cosh-asinhN/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f6471.5
Applied rewrites71.5%
if -1.04e-7 < t < 1.00000000000000004e-10Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6481.4
Applied rewrites81.4%
Taylor expanded in t around 0
Applied rewrites81.4%
Final simplification76.3%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh (tan t)) ew)))
(if (or (<= t -5.8e+37) (not (<= t 6e-25)))
(pow (sqrt (fabs (/ (fma (* t_1 eh) (cos t) (* (sin t) ew)) 1.0))) 2.0)
(fabs (* (tanh (asinh t_1)) eh)))))
double code(double eh, double ew, double t) {
double t_1 = (eh / tan(t)) / ew;
double tmp;
if ((t <= -5.8e+37) || !(t <= 6e-25)) {
tmp = pow(sqrt(fabs((fma((t_1 * eh), cos(t), (sin(t) * ew)) / 1.0))), 2.0);
} else {
tmp = fabs((tanh(asinh(t_1)) * eh));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(Float64(eh / tan(t)) / ew) tmp = 0.0 if ((t <= -5.8e+37) || !(t <= 6e-25)) tmp = sqrt(abs(Float64(fma(Float64(t_1 * eh), cos(t), Float64(sin(t) * ew)) / 1.0))) ^ 2.0; else tmp = abs(Float64(tanh(asinh(t_1)) * eh)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, If[Or[LessEqual[t, -5.8e+37], N[Not[LessEqual[t, 6e-25]], $MachinePrecision]], N[Power[N[Sqrt[N[Abs[N[(N[(N[(t$95$1 * eh), $MachinePrecision] * N[Cos[t], $MachinePrecision] + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision], N[Abs[N[(N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+37} \lor \neg \left(t \leq 6 \cdot 10^{-25}\right):\\
\;\;\;\;{\left(\sqrt{\left|\frac{\mathsf{fma}\left(t\_1 \cdot eh, \cos t, \sin t \cdot ew\right)}{1}\right|}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\left|\tanh \sinh^{-1} t\_1 \cdot eh\right|\\
\end{array}
\end{array}
if t < -5.79999999999999957e37 or 5.9999999999999995e-25 < t Initial program 99.7%
Applied rewrites40.9%
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-squareN/A
lower-fabs.f6476.0
Applied rewrites76.0%
Taylor expanded in eh around 0
Applied rewrites53.9%
if -5.79999999999999957e37 < t < 5.9999999999999995e-25Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6479.7
Applied rewrites79.7%
Applied rewrites79.7%
Final simplification66.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ (/ eh (tan t)) ew))
(t_2 (/ (fma (* (cos t) t_1) eh (* (sin t) ew)) 1.0)))
(if (<= t -6e+147)
t_2
(if (<= t -8.5e+37)
(* (sin (fabs t)) ew)
(if (<= t 1.1e-10) (fabs (* (tanh (asinh t_1)) eh)) t_2)))))
double code(double eh, double ew, double t) {
double t_1 = (eh / tan(t)) / ew;
double t_2 = fma((cos(t) * t_1), eh, (sin(t) * ew)) / 1.0;
double tmp;
if (t <= -6e+147) {
tmp = t_2;
} else if (t <= -8.5e+37) {
tmp = sin(fabs(t)) * ew;
} else if (t <= 1.1e-10) {
tmp = fabs((tanh(asinh(t_1)) * eh));
} else {
tmp = t_2;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(Float64(eh / tan(t)) / ew) t_2 = Float64(fma(Float64(cos(t) * t_1), eh, Float64(sin(t) * ew)) / 1.0) tmp = 0.0 if (t <= -6e+147) tmp = t_2; elseif (t <= -8.5e+37) tmp = Float64(sin(abs(t)) * ew); elseif (t <= 1.1e-10) tmp = abs(Float64(tanh(asinh(t_1)) * eh)); else tmp = t_2; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[Cos[t], $MachinePrecision] * t$95$1), $MachinePrecision] * eh + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]}, If[LessEqual[t, -6e+147], t$95$2, If[LessEqual[t, -8.5e+37], N[(N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision], If[LessEqual[t, 1.1e-10], N[Abs[N[(N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{eh}{\tan t}}{ew}\\
t_2 := \frac{\mathsf{fma}\left(\cos t \cdot t\_1, eh, \sin t \cdot ew\right)}{1}\\
\mathbf{if}\;t \leq -6 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{+37}:\\
\;\;\;\;\sin \left(\left|t\right|\right) \cdot ew\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-10}:\\
\;\;\;\;\left|\tanh \sinh^{-1} t\_1 \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -5.99999999999999987e147 or 1.09999999999999995e-10 < t Initial program 99.7%
Applied rewrites47.2%
Taylor expanded in eh around 0
Applied rewrites33.3%
if -5.99999999999999987e147 < t < -8.4999999999999999e37Initial program 99.7%
Applied rewrites21.0%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6415.4
Applied rewrites15.4%
Applied rewrites37.8%
if -8.4999999999999999e37 < t < 1.09999999999999995e-10Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6478.8
Applied rewrites78.8%
Applied rewrites78.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) ew)))
(if (<= t -6e+147)
t_1
(if (<= t -8.5e+37)
(* (sin (fabs t)) ew)
(if (<= t 1.1e-10)
(fabs (* (tanh (asinh (/ (/ eh (tan t)) ew))) eh))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * ew;
double tmp;
if (t <= -6e+147) {
tmp = t_1;
} else if (t <= -8.5e+37) {
tmp = sin(fabs(t)) * ew;
} else if (t <= 1.1e-10) {
tmp = fabs((tanh(asinh(((eh / tan(t)) / ew))) * eh));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * ew tmp = 0 if t <= -6e+147: tmp = t_1 elif t <= -8.5e+37: tmp = math.sin(math.fabs(t)) * ew elif t <= 1.1e-10: tmp = math.fabs((math.tanh(math.asinh(((eh / math.tan(t)) / ew))) * eh)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * ew) tmp = 0.0 if (t <= -6e+147) tmp = t_1; elseif (t <= -8.5e+37) tmp = Float64(sin(abs(t)) * ew); elseif (t <= 1.1e-10) tmp = abs(Float64(tanh(asinh(Float64(Float64(eh / tan(t)) / ew))) * eh)); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * ew; tmp = 0.0; if (t <= -6e+147) tmp = t_1; elseif (t <= -8.5e+37) tmp = sin(abs(t)) * ew; elseif (t <= 1.1e-10) tmp = abs((tanh(asinh(((eh / tan(t)) / ew))) * eh)); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[t, -6e+147], t$95$1, If[LessEqual[t, -8.5e+37], N[(N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision], If[LessEqual[t, 1.1e-10], N[Abs[N[(N[Tanh[N[ArcSinh[N[(N[(eh / N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
\mathbf{if}\;t \leq -6 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{+37}:\\
\;\;\;\;\sin \left(\left|t\right|\right) \cdot ew\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-10}:\\
\;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{\frac{eh}{\tan t}}{ew}\right) \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.99999999999999987e147 or 1.09999999999999995e-10 < t Initial program 99.7%
Applied rewrites47.2%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6433.1
Applied rewrites33.1%
if -5.99999999999999987e147 < t < -8.4999999999999999e37Initial program 99.7%
Applied rewrites21.0%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6415.4
Applied rewrites15.4%
Applied rewrites37.8%
if -8.4999999999999999e37 < t < 1.09999999999999995e-10Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6478.8
Applied rewrites78.8%
Applied rewrites78.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) ew)))
(if (<= t -6e+147)
t_1
(if (<= t -7.5e+37)
(* (sin (fabs t)) ew)
(if (<= t 4e-25)
(fabs
(*
(sin
(atan
(/ (fma (* (/ eh ew) -0.3333333333333333) (* t t) (/ eh ew)) t)))
eh))
t_1)))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * ew;
double tmp;
if (t <= -6e+147) {
tmp = t_1;
} else if (t <= -7.5e+37) {
tmp = sin(fabs(t)) * ew;
} else if (t <= 4e-25) {
tmp = fabs((sin(atan((fma(((eh / ew) * -0.3333333333333333), (t * t), (eh / ew)) / t))) * eh));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * ew) tmp = 0.0 if (t <= -6e+147) tmp = t_1; elseif (t <= -7.5e+37) tmp = Float64(sin(abs(t)) * ew); elseif (t <= 4e-25) tmp = abs(Float64(sin(atan(Float64(fma(Float64(Float64(eh / ew) * -0.3333333333333333), Float64(t * t), Float64(eh / ew)) / t))) * eh)); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[t, -6e+147], t$95$1, If[LessEqual[t, -7.5e+37], N[(N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision], If[LessEqual[t, 4e-25], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(N[(eh / ew), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * N[(t * t), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
\mathbf{if}\;t \leq -6 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{+37}:\\
\;\;\;\;\sin \left(\left|t\right|\right) \cdot ew\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-25}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(\frac{eh}{ew} \cdot -0.3333333333333333, t \cdot t, \frac{eh}{ew}\right)}{t}\right) \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.99999999999999987e147 or 4.00000000000000015e-25 < t Initial program 99.7%
Applied rewrites47.3%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6433.8
Applied rewrites33.8%
if -5.99999999999999987e147 < t < -7.5000000000000003e37Initial program 99.7%
Applied rewrites21.0%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6415.4
Applied rewrites15.4%
Applied rewrites37.8%
if -7.5000000000000003e37 < t < 4.00000000000000015e-25Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6479.7
Applied rewrites79.7%
Taylor expanded in t around 0
Applied rewrites59.7%
(FPCore (eh ew t) :precision binary64 (if (<= ew -4e-283) (* (* (fma -0.16666666666666666 (* (fabs t) t) 1.0) t) ew) (* (* (fma -0.16666666666666666 (* t t) 1.0) (fabs t)) ew)))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= -4e-283) {
tmp = (fma(-0.16666666666666666, (fabs(t) * t), 1.0) * t) * ew;
} else {
tmp = (fma(-0.16666666666666666, (t * t), 1.0) * fabs(t)) * ew;
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (ew <= -4e-283) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(abs(t) * t), 1.0) * t) * ew); else tmp = Float64(Float64(fma(-0.16666666666666666, Float64(t * t), 1.0) * abs(t)) * ew); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[ew, -4e-283], N[(N[(N[(-0.16666666666666666 * N[(N[Abs[t], $MachinePrecision] * t), $MachinePrecision] + 1.0), $MachinePrecision] * t), $MachinePrecision] * ew), $MachinePrecision], N[(N[(N[(-0.16666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq -4 \cdot 10^{-283}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, \left|t\right| \cdot t, 1\right) \cdot t\right) \cdot ew\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, t \cdot t, 1\right) \cdot \left|t\right|\right) \cdot ew\\
\end{array}
\end{array}
if ew < -3.99999999999999979e-283Initial program 99.8%
Applied rewrites35.8%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6422.4
Applied rewrites22.4%
Taylor expanded in t around 0
Applied rewrites6.5%
Applied rewrites8.2%
if -3.99999999999999979e-283 < ew Initial program 99.9%
Applied rewrites35.2%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6421.3
Applied rewrites21.3%
Taylor expanded in t around 0
Applied rewrites11.5%
Applied rewrites14.4%
(FPCore (eh ew t) :precision binary64 (* (* (fma -0.16666666666666666 (* t t) 1.0) t) ew))
double code(double eh, double ew, double t) {
return (fma(-0.16666666666666666, (t * t), 1.0) * t) * ew;
}
function code(eh, ew, t) return Float64(Float64(fma(-0.16666666666666666, Float64(t * t), 1.0) * t) * ew) end
code[eh_, ew_, t_] := N[(N[(N[(-0.16666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * t), $MachinePrecision] * ew), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(-0.16666666666666666, t \cdot t, 1\right) \cdot t\right) \cdot ew
\end{array}
Initial program 99.8%
Applied rewrites35.5%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6421.8
Applied rewrites21.8%
Taylor expanded in t around 0
Applied rewrites9.2%
(FPCore (eh ew t) :precision binary64 (* (* (* (* t t) -0.16666666666666666) t) ew))
double code(double eh, double ew, double t) {
return (((t * t) * -0.16666666666666666) * 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 = (((t * t) * (-0.16666666666666666d0)) * t) * ew
end function
public static double code(double eh, double ew, double t) {
return (((t * t) * -0.16666666666666666) * t) * ew;
}
def code(eh, ew, t): return (((t * t) * -0.16666666666666666) * t) * ew
function code(eh, ew, t) return Float64(Float64(Float64(Float64(t * t) * -0.16666666666666666) * t) * ew) end
function tmp = code(eh, ew, t) tmp = (((t * t) * -0.16666666666666666) * t) * ew; end
code[eh_, ew_, t_] := N[(N[(N[(N[(t * t), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] * t), $MachinePrecision] * ew), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(t \cdot t\right) \cdot -0.16666666666666666\right) \cdot t\right) \cdot ew
\end{array}
Initial program 99.8%
Applied rewrites35.5%
Taylor expanded in eh around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6421.8
Applied rewrites21.8%
Taylor expanded in t around 0
Applied rewrites9.2%
Taylor expanded in t around inf
Applied rewrites2.7%
herbie shell --seed 2024339
(FPCore (eh ew t)
:name "Example from Robby"
:precision binary64
(fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))