
(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 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((-eh * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (* eh (/ (tan t) ew))))) (fabs (fma (* (cos t) (cos t_1)) ew (* (* (sin t) eh) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan((eh * (tan(t) / ew)));
return fabs(fma((cos(t) * cos(t_1)), ew, ((sin(t) * eh) * sin(t_1))));
}
function code(eh, ew, t) t_1 = atan(Float64(eh * Float64(tan(t) / ew))) return abs(fma(Float64(cos(t) * cos(t_1)), ew, Float64(Float64(sin(t) * eh) * sin(t_1)))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right)\\
\left|\mathsf{fma}\left(\cos t \cdot \cos t\_1, ew, \left(\sin t \cdot eh\right) \cdot \sin t\_1\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Final simplification99.8%
(FPCore (eh ew t) :precision binary64 (fabs (fma (* (cos t) (cos (atan (* eh (/ (tan t) ew))))) ew (* (* (sin t) eh) (sin (atan (* (/ t ew) eh)))))))
double code(double eh, double ew, double t) {
return fabs(fma((cos(t) * cos(atan((eh * (tan(t) / ew))))), ew, ((sin(t) * eh) * sin(atan(((t / ew) * eh))))));
}
function code(eh, ew, t) return abs(fma(Float64(cos(t) * cos(atan(Float64(eh * Float64(tan(t) / ew))))), ew, Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(t / ew) * eh)))))) end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * N[Cos[N[ArcTan[N[(eh * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(\cos t \cdot \cos \tan^{-1} \left(eh \cdot \frac{\tan t}{ew}\right), ew, \left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot eh\right)\right)\right|
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f6499.2
Applied rewrites99.2%
Final simplification99.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) ew))
(t_2
(fabs
(fma
(* (- eh) (sin t))
(sin (atan (/ (* (- eh) t) ew)))
(* (cos (atan (* (/ t ew) eh))) t_1)))))
(if (<= eh -2.45e-109)
t_2
(if (<= eh 1.2e-186)
(fabs (* (cos (atan (* (/ (sin t) ew) (/ eh (cos t))))) t_1))
t_2))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * ew;
double t_2 = fabs(fma((-eh * sin(t)), sin(atan(((-eh * t) / ew))), (cos(atan(((t / ew) * eh))) * t_1)));
double tmp;
if (eh <= -2.45e-109) {
tmp = t_2;
} else if (eh <= 1.2e-186) {
tmp = fabs((cos(atan(((sin(t) / ew) * (eh / cos(t))))) * t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(cos(t) * ew) t_2 = abs(fma(Float64(Float64(-eh) * sin(t)), sin(atan(Float64(Float64(Float64(-eh) * t) / ew))), Float64(cos(atan(Float64(Float64(t / ew) * eh))) * t_1))) tmp = 0.0 if (eh <= -2.45e-109) tmp = t_2; elseif (eh <= 1.2e-186) tmp = abs(Float64(cos(atan(Float64(Float64(sin(t) / ew) * Float64(eh / cos(t))))) * t_1)); else tmp = t_2; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(N[((-eh) * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[((-eh) * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[ArcTan[N[(N[(t / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.45e-109], t$95$2, If[LessEqual[eh, 1.2e-186], N[Abs[N[(N[Cos[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot ew\\
t_2 := \left|\mathsf{fma}\left(\left(-eh\right) \cdot \sin t, \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot t}{ew}\right), \cos \tan^{-1} \left(\frac{t}{ew} \cdot eh\right) \cdot t\_1\right)\right|\\
\mathbf{if}\;eh \leq -2.45 \cdot 10^{-109}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eh \leq 1.2 \cdot 10^{-186}:\\
\;\;\;\;\left|\cos \tan^{-1} \left(\frac{\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if eh < -2.44999999999999999e-109 or 1.20000000000000002e-186 < eh Initial program 99.8%
Taylor expanded in t around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.0
Applied rewrites99.0%
Applied rewrites99.0%
Taylor expanded in t around 0
lower-/.f6493.3
Applied rewrites93.3%
if -2.44999999999999999e-109 < eh < 1.20000000000000002e-186Initial program 99.9%
Applied rewrites59.8%
Taylor expanded in ew around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-cos.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.f6499.9
Applied rewrites99.9%
Final simplification94.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(* (cos (atan (* (/ (sin t) ew) (/ eh (cos t))))) (* (cos t) ew)))))
(if (<= ew -1.85e-177)
t_1
(if (<= ew 7e-70)
(fabs (* (* (sin t) eh) (sin (atan (/ (* eh t) ew)))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((cos(atan(((sin(t) / ew) * (eh / cos(t))))) * (cos(t) * ew)));
double tmp;
if (ew <= -1.85e-177) {
tmp = t_1;
} else if (ew <= 7e-70) {
tmp = fabs(((sin(t) * eh) * sin(atan(((eh * 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((cos(atan(((sin(t) / ew) * (eh / cos(t))))) * (cos(t) * ew)))
if (ew <= (-1.85d-177)) then
tmp = t_1
else if (ew <= 7d-70) then
tmp = abs(((sin(t) * eh) * sin(atan(((eh * 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.cos(Math.atan(((Math.sin(t) / ew) * (eh / Math.cos(t))))) * (Math.cos(t) * ew)));
double tmp;
if (ew <= -1.85e-177) {
tmp = t_1;
} else if (ew <= 7e-70) {
tmp = Math.abs(((Math.sin(t) * eh) * Math.sin(Math.atan(((eh * t) / ew)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.cos(math.atan(((math.sin(t) / ew) * (eh / math.cos(t))))) * (math.cos(t) * ew))) tmp = 0 if ew <= -1.85e-177: tmp = t_1 elif ew <= 7e-70: tmp = math.fabs(((math.sin(t) * eh) * math.sin(math.atan(((eh * t) / ew))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(cos(atan(Float64(Float64(sin(t) / ew) * Float64(eh / cos(t))))) * Float64(cos(t) * ew))) tmp = 0.0 if (ew <= -1.85e-177) tmp = t_1; elseif (ew <= 7e-70) tmp = abs(Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(eh * t) / ew))))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((cos(atan(((sin(t) / ew) * (eh / cos(t))))) * (cos(t) * ew))); tmp = 0.0; if (ew <= -1.85e-177) tmp = t_1; elseif (ew <= 7e-70) tmp = abs(((sin(t) * eh) * sin(atan(((eh * t) / ew))))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Cos[N[ArcTan[N[(N[(N[Sin[t], $MachinePrecision] / ew), $MachinePrecision] * N[(eh / N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -1.85e-177], t$95$1, If[LessEqual[ew, 7e-70], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\cos \tan^{-1} \left(\frac{\sin t}{ew} \cdot \frac{eh}{\cos t}\right) \cdot \left(\cos t \cdot ew\right)\right|\\
\mathbf{if}\;ew \leq -1.85 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 7 \cdot 10^{-70}:\\
\;\;\;\;\left|\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -1.84999999999999997e-177 or 6.99999999999999949e-70 < ew Initial program 99.8%
Applied rewrites49.2%
Taylor expanded in ew around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-cos.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.f6477.1
Applied rewrites77.1%
if -1.84999999999999997e-177 < ew < 6.99999999999999949e-70Initial program 99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift-cos.f64N/A
lift-cos.f64N/A
cos-multN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64N/A
lower--.f64N/A
lower-cos.f64N/A
Applied rewrites99.8%
Taylor expanded in ew around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.8%
Taylor expanded in t around 0
Applied rewrites76.9%
Final simplification77.1%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* (* (sin t) eh) (sin (atan (/ (* eh t) ew))))))) (if (<= t -3.5e-72) t_1 (if (<= t 1800.0) (fabs (/ ew 1.0)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs(((sin(t) * eh) * sin(atan(((eh * t) / ew)))));
double tmp;
if (t <= -3.5e-72) {
tmp = t_1;
} else if (t <= 1800.0) {
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(t) * eh) * sin(atan(((eh * t) / ew)))))
if (t <= (-3.5d-72)) then
tmp = t_1
else if (t <= 1800.0d0) 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(t) * eh) * Math.sin(Math.atan(((eh * t) / ew)))));
double tmp;
if (t <= -3.5e-72) {
tmp = t_1;
} else if (t <= 1800.0) {
tmp = Math.abs((ew / 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs(((math.sin(t) * eh) * math.sin(math.atan(((eh * t) / ew))))) tmp = 0 if t <= -3.5e-72: tmp = t_1 elif t <= 1800.0: tmp = math.fabs((ew / 1.0)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(Float64(sin(t) * eh) * sin(atan(Float64(Float64(eh * t) / ew))))) tmp = 0.0 if (t <= -3.5e-72) tmp = t_1; elseif (t <= 1800.0) 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(t) * eh) * sin(atan(((eh * t) / ew))))); tmp = 0.0; if (t <= -3.5e-72) tmp = t_1; elseif (t <= 1800.0) 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[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.5e-72], t$95$1, If[LessEqual[t, 1800.0], N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\left(\sin t \cdot eh\right) \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{ew}\right)\right|\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1800:\\
\;\;\;\;\left|\frac{ew}{1}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.5e-72 or 1800 < t Initial program 99.7%
Applied rewrites99.7%
lift-*.f64N/A
lift-cos.f64N/A
lift-cos.f64N/A
cos-multN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64N/A
lower--.f64N/A
lower-cos.f64N/A
Applied rewrites98.4%
Taylor expanded in ew around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.2%
Taylor expanded in t around 0
Applied rewrites51.5%
if -3.5e-72 < t < 1800Initial program 100.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.6%
Taylor expanded in t around 0
Applied rewrites78.6%
Applied rewrites78.5%
Taylor expanded in ew around inf
Applied rewrites78.7%
Final simplification63.8%
(FPCore (eh ew t) :precision binary64 (fabs (/ ew 1.0)))
double code(double eh, double ew, double t) {
return fabs((ew / 1.0));
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew / 1.0d0))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew / 1.0));
}
def code(eh, ew, t): return math.fabs((ew / 1.0))
function code(eh, ew, t) return abs(Float64(ew / 1.0)) end
function tmp = code(eh, ew, t) tmp = abs((ew / 1.0)); end
code[eh_, ew_, t_] := N[Abs[N[(ew / 1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{ew}{1}\right|
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites44.7%
Taylor expanded in t around 0
Applied rewrites43.6%
Applied rewrites42.7%
Taylor expanded in ew around inf
Applied rewrites44.8%
herbie shell --seed 2024268
(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)))))))