
(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 15 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 (fabs (+ (* (* (cos t) eh) (sin (atan (/ eh (* (tan t) ew))))) (* (* (sin t) ew) (cos (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
return fabs((((cos(t) * eh) * sin(atan((eh / (tan(t) * ew))))) + ((sin(t) * ew) * cos(atan(((eh / ew) / tan(t)))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((((cos(t) * eh) * sin(atan((eh / (tan(t) * ew))))) + ((sin(t) * ew) * cos(atan(((eh / ew) / tan(t)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((Math.cos(t) * eh) * Math.sin(Math.atan((eh / (Math.tan(t) * ew))))) + ((Math.sin(t) * ew) * Math.cos(Math.atan(((eh / ew) / Math.tan(t)))))));
}
def code(eh, ew, t): return math.fabs((((math.cos(t) * eh) * math.sin(math.atan((eh / (math.tan(t) * ew))))) + ((math.sin(t) * ew) * math.cos(math.atan(((eh / ew) / math.tan(t)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(cos(t) * eh) * sin(atan(Float64(eh / Float64(tan(t) * ew))))) + Float64(Float64(sin(t) * ew) * cos(atan(Float64(Float64(eh / ew) / tan(t))))))) end
function tmp = code(eh, ew, t) tmp = abs((((cos(t) * eh) * sin(atan((eh / (tan(t) * ew))))) + ((sin(t) * ew) * cos(atan(((eh / ew) / tan(t))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[t], $MachinePrecision] * ew), $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(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) + \left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\end{array}
Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (+ (* (* (sin t) ew) (cos (atan (/ eh (* t ew))))) (* (* (cos t) eh) (sin (atan (/ eh (* (tan t) ew))))))))
double code(double eh, double ew, double t) {
return fabs((((sin(t) * ew) * cos(atan((eh / (t * ew))))) + ((cos(t) * eh) * sin(atan((eh / (tan(t) * ew)))))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((((sin(t) * ew) * cos(atan((eh / (t * ew))))) + ((cos(t) * eh) * sin(atan((eh / (tan(t) * ew)))))))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((((Math.sin(t) * ew) * Math.cos(Math.atan((eh / (t * ew))))) + ((Math.cos(t) * eh) * Math.sin(Math.atan((eh / (Math.tan(t) * ew)))))));
}
def code(eh, ew, t): return math.fabs((((math.sin(t) * ew) * math.cos(math.atan((eh / (t * ew))))) + ((math.cos(t) * eh) * math.sin(math.atan((eh / (math.tan(t) * ew)))))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(sin(t) * ew) * cos(atan(Float64(eh / Float64(t * ew))))) + Float64(Float64(cos(t) * eh) * sin(atan(Float64(eh / Float64(tan(t) * ew))))))) end
function tmp = code(eh, ew, t) tmp = abs((((sin(t) * ew) * cos(atan((eh / (t * ew))))) + ((cos(t) * eh) * sin(atan((eh / (tan(t) * ew))))))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left(\sin t \cdot ew\right) \cdot \cos \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) + \left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right|
\end{array}
Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
Final simplification99.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* t ew))))
(fabs
(fma
(/ 1.0 (sqrt (fma t_1 t_1 1.0)))
(* (sin t) ew)
(* (* (cos t) eh) (sin (atan (/ eh (* (tan t) ew)))))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (t * ew);
return fabs(fma((1.0 / sqrt(fma(t_1, t_1, 1.0))), (sin(t) * ew), ((cos(t) * eh) * sin(atan((eh / (tan(t) * ew)))))));
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(t * ew)) return abs(fma(Float64(1.0 / sqrt(fma(t_1, t_1, 1.0))), Float64(sin(t) * ew), Float64(Float64(cos(t) * eh) * sin(atan(Float64(eh / Float64(tan(t) * ew))))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(1.0 / N[Sqrt[N[(t$95$1 * t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] + N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
\left|\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}, \sin t \cdot ew, \left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-fma.f6499.4
Applied rewrites99.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* t ew))))
(fabs
(fma
(cos t)
(* (sin (atan (/ eh (* (tan t) ew)))) eh)
(/ (* (sin t) ew) (sqrt (fma t_1 t_1 1.0)))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (t * ew);
return fabs(fma(cos(t), (sin(atan((eh / (tan(t) * ew)))) * eh), ((sin(t) * ew) / sqrt(fma(t_1, t_1, 1.0)))));
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(t * ew)) return abs(fma(cos(t), Float64(sin(atan(Float64(eh / Float64(tan(t) * ew)))) * eh), Float64(Float64(sin(t) * ew) / sqrt(fma(t_1, t_1, 1.0))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[Cos[t], $MachinePrecision] * N[(N[Sin[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision] + N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] / N[Sqrt[N[(t$95$1 * t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
\left|\mathsf{fma}\left(\cos t, \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh, \frac{\sin t \cdot ew}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}\right)\right|
\end{array}
\end{array}
Initial program 99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6499.4
lift-*.f64N/A
Applied rewrites99.4%
Final simplification99.4%
(FPCore (eh ew t) :precision binary64 (fabs (fma (sin t) ew (* (* (cos t) eh) (sin (atan (/ eh (* (tan t) ew))))))))
double code(double eh, double ew, double t) {
return fabs(fma(sin(t), ew, ((cos(t) * eh) * sin(atan((eh / (tan(t) * ew)))))));
}
function code(eh, ew, t) return abs(fma(sin(t), ew, Float64(Float64(cos(t) * eh) * sin(atan(Float64(eh / Float64(tan(t) * ew))))))) end
code[eh_, ew_, t_] := N[Abs[N[(N[Sin[t], $MachinePrecision] * ew + N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(\sin t, ew, \left(\cos t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right)\right|
\end{array}
Initial program 99.8%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites88.5%
Taylor expanded in ew around inf
lower-sin.f6498.8
Applied rewrites98.8%
Final simplification98.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* t ew))) (t_2 (* (sin t) ew)))
(if (<= t -1.8e+35)
(fabs (fma (/ eh (* (tan t) ew)) t_2 (/ t_2 1.0)))
(fabs
(fma
(/ 1.0 (sqrt (fma t_1 t_1 1.0)))
t_2
(* (sin (atan t_1)) (* (cos t) eh)))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (t * ew);
double t_2 = sin(t) * ew;
double tmp;
if (t <= -1.8e+35) {
tmp = fabs(fma((eh / (tan(t) * ew)), t_2, (t_2 / 1.0)));
} else {
tmp = fabs(fma((1.0 / sqrt(fma(t_1, t_1, 1.0))), t_2, (sin(atan(t_1)) * (cos(t) * eh))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(t * ew)) t_2 = Float64(sin(t) * ew) tmp = 0.0 if (t <= -1.8e+35) tmp = abs(fma(Float64(eh / Float64(tan(t) * ew)), t_2, Float64(t_2 / 1.0))); else tmp = abs(fma(Float64(1.0 / sqrt(fma(t_1, t_1, 1.0))), t_2, Float64(sin(atan(t_1)) * Float64(cos(t) * eh)))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[t, -1.8e+35], N[Abs[N[(N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] * t$95$2 + N[(t$95$2 / 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(1.0 / N[Sqrt[N[(t$95$1 * t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2 + N[(N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
t_2 := \sin t \cdot ew\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+35}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, t\_2, \frac{t\_2}{1}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}, t\_2, \sin \tan^{-1} t\_1 \cdot \left(\cos t \cdot eh\right)\right)\right|\\
\end{array}
\end{array}
if t < -1.8e35Initial program 99.5%
Applied rewrites53.7%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6473.8
Applied rewrites73.8%
Taylor expanded in ew around inf
Applied rewrites88.6%
if -1.8e35 < t Initial program 99.9%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6499.7
Applied rewrites99.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in t around 0
lower-*.f6494.6
Applied rewrites94.6%
Final simplification93.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) ew)))
(if (<= t -1.8e+35)
(fabs (fma (/ eh (* (tan t) ew)) t_1 (/ t_1 1.0)))
(fabs (fma (sin t) ew (* (sin (atan (/ eh (* t ew)))) (* (cos t) eh)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * ew;
double tmp;
if (t <= -1.8e+35) {
tmp = fabs(fma((eh / (tan(t) * ew)), t_1, (t_1 / 1.0)));
} else {
tmp = fabs(fma(sin(t), ew, (sin(atan((eh / (t * ew)))) * (cos(t) * eh))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * ew) tmp = 0.0 if (t <= -1.8e+35) tmp = abs(fma(Float64(eh / Float64(tan(t) * ew)), t_1, Float64(t_1 / 1.0))); else tmp = abs(fma(sin(t), ew, Float64(sin(atan(Float64(eh / Float64(t * ew)))) * Float64(cos(t) * eh)))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[t, -1.8e+35], N[Abs[N[(N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(t$95$1 / 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew + N[(N[Sin[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+35}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, t\_1, \frac{t\_1}{1}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(\sin t, ew, \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right)\right|\\
\end{array}
\end{array}
if t < -1.8e35Initial program 99.5%
Applied rewrites53.7%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6473.8
Applied rewrites73.8%
Taylor expanded in ew around inf
Applied rewrites88.6%
if -1.8e35 < t Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites89.8%
Taylor expanded in ew around inf
lower-sin.f6499.0
Applied rewrites99.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6493.8
Applied rewrites93.8%
Final simplification92.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) ew))
(t_2 (fabs (fma (/ eh (* (tan t) ew)) t_1 (/ t_1 1.0)))))
(if (<= t -155000000000.0)
t_2
(if (<= t 1.75e-6)
(fabs
(fma
(* (fma -0.16666666666666666 (* t t) 1.0) t)
ew
(* (sin (atan (/ eh (* t ew)))) (* (cos t) eh))))
t_2))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * ew;
double t_2 = fabs(fma((eh / (tan(t) * ew)), t_1, (t_1 / 1.0)));
double tmp;
if (t <= -155000000000.0) {
tmp = t_2;
} else if (t <= 1.75e-6) {
tmp = fabs(fma((fma(-0.16666666666666666, (t * t), 1.0) * t), ew, (sin(atan((eh / (t * ew)))) * (cos(t) * eh))));
} else {
tmp = t_2;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * ew) t_2 = abs(fma(Float64(eh / Float64(tan(t) * ew)), t_1, Float64(t_1 / 1.0))) tmp = 0.0 if (t <= -155000000000.0) tmp = t_2; elseif (t <= 1.75e-6) tmp = abs(fma(Float64(fma(-0.16666666666666666, Float64(t * t), 1.0) * t), ew, Float64(sin(atan(Float64(eh / Float64(t * ew)))) * Float64(cos(t) * eh)))); else tmp = t_2; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(t$95$1 / 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -155000000000.0], t$95$2, If[LessEqual[t, 1.75e-6], N[Abs[N[(N[(N[(-0.16666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * t), $MachinePrecision] * ew + N[(N[Sin[N[ArcTan[N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
t_2 := \left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, t\_1, \frac{t\_1}{1}\right)\right|\\
\mathbf{if}\;t \leq -155000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-6}:\\
\;\;\;\;\left|\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, t \cdot t, 1\right) \cdot t, ew, \sin \tan^{-1} \left(\frac{eh}{t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.55e11 or 1.74999999999999997e-6 < t Initial program 99.6%
Applied rewrites59.7%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6475.3
Applied rewrites75.3%
Taylor expanded in ew around inf
Applied rewrites86.8%
if -1.55e11 < t < 1.74999999999999997e-6Initial program 100.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites89.6%
Taylor expanded in ew around inf
lower-sin.f6498.9
Applied rewrites98.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6498.9
Applied rewrites98.9%
Taylor expanded in t around 0
Applied rewrites98.8%
Final simplification93.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) ew))
(t_2 (fabs (fma (/ eh (* (tan t) ew)) t_1 (/ t_1 1.0)))))
(if (<= ew -11500.0) t_2 (if (<= ew 7.8e-46) (fabs (* (cos t) eh)) t_2))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * ew;
double t_2 = fabs(fma((eh / (tan(t) * ew)), t_1, (t_1 / 1.0)));
double tmp;
if (ew <= -11500.0) {
tmp = t_2;
} else if (ew <= 7.8e-46) {
tmp = fabs((cos(t) * eh));
} else {
tmp = t_2;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * ew) t_2 = abs(fma(Float64(eh / Float64(tan(t) * ew)), t_1, Float64(t_1 / 1.0))) tmp = 0.0 if (ew <= -11500.0) tmp = t_2; elseif (ew <= 7.8e-46) tmp = abs(Float64(cos(t) * eh)); else tmp = t_2; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(t$95$1 / 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -11500.0], t$95$2, If[LessEqual[ew, 7.8e-46], N[Abs[N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
t_2 := \left|\mathsf{fma}\left(\frac{eh}{\tan t \cdot ew}, t\_1, \frac{t\_1}{1}\right)\right|\\
\mathbf{if}\;ew \leq -11500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 7.8 \cdot 10^{-46}:\\
\;\;\;\;\left|\cos t \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -11500 or 7.8000000000000005e-46 < ew Initial program 99.8%
Applied rewrites74.3%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6486.3
Applied rewrites86.3%
Taylor expanded in ew around inf
Applied rewrites91.5%
if -11500 < ew < 7.8000000000000005e-46Initial program 99.8%
Applied rewrites15.2%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6488.0
Applied rewrites88.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) eh))
(t_2 (/ eh (* t ew)))
(t_3 (fabs (fma (/ t_2 (sqrt (fma t_2 t_2 1.0))) t_1 (* (sin t) ew)))))
(if (<= ew -70000000000.0) t_3 (if (<= ew 1.65e+56) (fabs t_1) t_3))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * eh;
double t_2 = eh / (t * ew);
double t_3 = fabs(fma((t_2 / sqrt(fma(t_2, t_2, 1.0))), t_1, (sin(t) * ew)));
double tmp;
if (ew <= -70000000000.0) {
tmp = t_3;
} else if (ew <= 1.65e+56) {
tmp = fabs(t_1);
} else {
tmp = t_3;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(cos(t) * eh) t_2 = Float64(eh / Float64(t * ew)) t_3 = abs(fma(Float64(t_2 / sqrt(fma(t_2, t_2, 1.0))), t_1, Float64(sin(t) * ew))) tmp = 0.0 if (ew <= -70000000000.0) tmp = t_3; elseif (ew <= 1.65e+56) tmp = abs(t_1); else tmp = t_3; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(N[(t$95$2 / N[Sqrt[N[(t$95$2 * t$95$2 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -70000000000.0], t$95$3, If[LessEqual[ew, 1.65e+56], N[Abs[t$95$1], $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot eh\\
t_2 := \frac{eh}{t \cdot ew}\\
t_3 := \left|\mathsf{fma}\left(\frac{t\_2}{\sqrt{\mathsf{fma}\left(t\_2, t\_2, 1\right)}}, t\_1, \sin t \cdot ew\right)\right|\\
\mathbf{if}\;ew \leq -70000000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;ew \leq 1.65 \cdot 10^{+56}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if ew < -7e10 or 1.65000000000000001e56 < ew Initial program 99.8%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.3%
Taylor expanded in ew around inf
lower-sin.f6498.9
Applied rewrites98.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6495.2
Applied rewrites95.2%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites86.6%
if -7e10 < ew < 1.65000000000000001e56Initial program 99.8%
Applied rewrites19.0%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6486.4
Applied rewrites86.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) ew)))
(if (<= ew -1.35e+32)
(fabs t_1)
(if (<= ew 4.8e+56) (fabs (* (cos t) eh)) (/ 1.0 (fabs (/ 1.0 t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * ew;
double tmp;
if (ew <= -1.35e+32) {
tmp = fabs(t_1);
} else if (ew <= 4.8e+56) {
tmp = fabs((cos(t) * eh));
} else {
tmp = 1.0 / fabs((1.0 / 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 = sin(t) * ew
if (ew <= (-1.35d+32)) then
tmp = abs(t_1)
else if (ew <= 4.8d+56) then
tmp = abs((cos(t) * eh))
else
tmp = 1.0d0 / abs((1.0d0 / t_1))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sin(t) * ew;
double tmp;
if (ew <= -1.35e+32) {
tmp = Math.abs(t_1);
} else if (ew <= 4.8e+56) {
tmp = Math.abs((Math.cos(t) * eh));
} else {
tmp = 1.0 / Math.abs((1.0 / t_1));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * ew tmp = 0 if ew <= -1.35e+32: tmp = math.fabs(t_1) elif ew <= 4.8e+56: tmp = math.fabs((math.cos(t) * eh)) else: tmp = 1.0 / math.fabs((1.0 / t_1)) return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * ew) tmp = 0.0 if (ew <= -1.35e+32) tmp = abs(t_1); elseif (ew <= 4.8e+56) tmp = abs(Float64(cos(t) * eh)); else tmp = Float64(1.0 / abs(Float64(1.0 / t_1))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sin(t) * ew; tmp = 0.0; if (ew <= -1.35e+32) tmp = abs(t_1); elseif (ew <= 4.8e+56) tmp = abs((cos(t) * eh)); else tmp = 1.0 / abs((1.0 / t_1)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, If[LessEqual[ew, -1.35e+32], N[Abs[t$95$1], $MachinePrecision], If[LessEqual[ew, 4.8e+56], N[Abs[N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[Abs[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
\mathbf{if}\;ew \leq -1.35 \cdot 10^{+32}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{elif}\;ew \leq 4.8 \cdot 10^{+56}:\\
\;\;\;\;\left|\cos t \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|\frac{1}{t\_1}\right|}\\
\end{array}
\end{array}
if ew < -1.35000000000000006e32Initial program 99.9%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites93.2%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6471.5
Applied rewrites71.5%
if -1.35000000000000006e32 < ew < 4.80000000000000027e56Initial program 99.8%
Applied rewrites22.5%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6485.7
Applied rewrites85.7%
if 4.80000000000000027e56 < ew Initial program 99.7%
Applied rewrites94.6%
Taylor expanded in ew around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6475.0
Applied rewrites75.0%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* (sin t) ew)))) (if (<= ew -1.35e+32) t_1 (if (<= ew 1.65e+56) (fabs (* (cos t) eh)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * ew));
double tmp;
if (ew <= -1.35e+32) {
tmp = t_1;
} else if (ew <= 1.65e+56) {
tmp = fabs((cos(t) * 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(t) * ew))
if (ew <= (-1.35d+32)) then
tmp = t_1
else if (ew <= 1.65d+56) then
tmp = abs((cos(t) * 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(t) * ew));
double tmp;
if (ew <= -1.35e+32) {
tmp = t_1;
} else if (ew <= 1.65e+56) {
tmp = Math.abs((Math.cos(t) * eh));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(t) * ew)) tmp = 0 if ew <= -1.35e+32: tmp = t_1 elif ew <= 1.65e+56: tmp = math.fabs((math.cos(t) * eh)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(t) * ew)) tmp = 0.0 if (ew <= -1.35e+32) tmp = t_1; elseif (ew <= 1.65e+56) tmp = abs(Float64(cos(t) * eh)); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((sin(t) * ew)); tmp = 0.0; if (ew <= -1.35e+32) tmp = t_1; elseif (ew <= 1.65e+56) tmp = abs((cos(t) * eh)); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.35e+32], t$95$1, If[LessEqual[ew, 1.65e+56], N[Abs[N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin t \cdot ew\right|\\
\mathbf{if}\;ew \leq -1.35 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 1.65 \cdot 10^{+56}:\\
\;\;\;\;\left|\cos t \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -1.35000000000000006e32 or 1.65000000000000001e56 < ew Initial program 99.8%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.0%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6473.2
Applied rewrites73.2%
if -1.35000000000000006e32 < ew < 1.65000000000000001e56Initial program 99.8%
Applied rewrites22.5%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6485.7
Applied rewrites85.7%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (* (sin t) ew))) (if (<= ew -1.48e+200) t_1 (if (<= ew 7.6e+86) (fabs (* (cos t) eh)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * ew;
double tmp;
if (ew <= -1.48e+200) {
tmp = t_1;
} else if (ew <= 7.6e+86) {
tmp = fabs((cos(t) * 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 = sin(t) * ew
if (ew <= (-1.48d+200)) then
tmp = t_1
else if (ew <= 7.6d+86) then
tmp = abs((cos(t) * 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.sin(t) * ew;
double tmp;
if (ew <= -1.48e+200) {
tmp = t_1;
} else if (ew <= 7.6e+86) {
tmp = Math.abs((Math.cos(t) * eh));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * ew tmp = 0 if ew <= -1.48e+200: tmp = t_1 elif ew <= 7.6e+86: tmp = math.fabs((math.cos(t) * eh)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * ew) tmp = 0.0 if (ew <= -1.48e+200) tmp = t_1; elseif (ew <= 7.6e+86) tmp = abs(Float64(cos(t) * 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 (ew <= -1.48e+200) tmp = t_1; elseif (ew <= 7.6e+86) tmp = abs((cos(t) * 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[ew, -1.48e+200], t$95$1, If[LessEqual[ew, 7.6e+86], N[Abs[N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
\mathbf{if}\;ew \leq -1.48 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 7.6 \cdot 10^{+86}:\\
\;\;\;\;\left|\cos t \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -1.48000000000000008e200 or 7.59999999999999956e86 < ew Initial program 99.8%
Applied rewrites92.6%
lift-/.f64N/A
inv-powN/A
sqr-powN/A
pow2N/A
lower-pow.f64N/A
Applied rewrites45.3%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6443.5
Applied rewrites43.5%
if -1.48000000000000008e200 < ew < 7.59999999999999956e86Initial program 99.8%
Applied rewrites35.9%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6474.0
Applied rewrites74.0%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (* (sin t) ew))) (if (<= t -8.2e+67) t_1 (if (<= t 1.45e-19) (fabs (* 1.0 eh)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * ew;
double tmp;
if (t <= -8.2e+67) {
tmp = t_1;
} else if (t <= 1.45e-19) {
tmp = fabs((1.0 * 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 = sin(t) * ew
if (t <= (-8.2d+67)) then
tmp = t_1
else if (t <= 1.45d-19) then
tmp = abs((1.0d0 * 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.sin(t) * ew;
double tmp;
if (t <= -8.2e+67) {
tmp = t_1;
} else if (t <= 1.45e-19) {
tmp = Math.abs((1.0 * eh));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sin(t) * ew tmp = 0 if t <= -8.2e+67: tmp = t_1 elif t <= 1.45e-19: tmp = math.fabs((1.0 * eh)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(sin(t) * ew) tmp = 0.0 if (t <= -8.2e+67) tmp = t_1; elseif (t <= 1.45e-19) tmp = abs(Float64(1.0 * 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 <= -8.2e+67) tmp = t_1; elseif (t <= 1.45e-19) tmp = abs((1.0 * 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, -8.2e+67], t$95$1, If[LessEqual[t, 1.45e-19], N[Abs[N[(1.0 * eh), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot ew\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-19}:\\
\;\;\;\;\left|1 \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.19999999999999959e67 or 1.45e-19 < t Initial program 99.6%
Applied rewrites86.8%
lift-/.f64N/A
inv-powN/A
sqr-powN/A
pow2N/A
lower-pow.f64N/A
Applied rewrites47.9%
Taylor expanded in ew around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6433.4
Applied rewrites33.4%
if -8.19999999999999959e67 < t < 1.45e-19Initial program 100.0%
Applied rewrites39.5%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.6
Applied rewrites73.6%
Taylor expanded in t around 0
Applied rewrites69.0%
(FPCore (eh ew t) :precision binary64 (fabs (* 1.0 eh)))
double code(double eh, double ew, double t) {
return fabs((1.0 * eh));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((1.0d0 * eh))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((1.0 * eh));
}
def code(eh, ew, t): return math.fabs((1.0 * eh))
function code(eh, ew, t) return abs(Float64(1.0 * eh)) end
function tmp = code(eh, ew, t) tmp = abs((1.0 * eh)); end
code[eh_, ew_, t_] := N[Abs[N[(1.0 * eh), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|1 \cdot eh\right|
\end{array}
Initial program 99.8%
Applied rewrites49.1%
Taylor expanded in ew around 0
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6460.1
Applied rewrites60.1%
Taylor expanded in t around 0
Applied rewrites43.1%
herbie shell --seed 2024240
(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))))))))