
(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 8 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 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}
Initial program 99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew t))))
(fabs
(fma
(/ (sin t) (sqrt (fma t_1 t_1 1.0)))
ew
(* eh (* (cos t) (sin (atan (/ eh (* ew (tan t)))))))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
return fabs(fma((sin(t) / sqrt(fma(t_1, t_1, 1.0))), ew, (eh * (cos(t) * sin(atan((eh / (ew * tan(t)))))))));
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * t)) return abs(fma(Float64(sin(t) / sqrt(fma(t_1, t_1, 1.0))), ew, Float64(eh * Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * tan(t))))))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t], $MachinePrecision] / N[Sqrt[N[(t$95$1 * t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
\left|\mathsf{fma}\left(\frac{\sin t}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}, ew, eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.1
Applied rewrites99.1%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew t))))
(if (<= t 8.2e+99)
(fabs
(fma
(/ (sin t) (sqrt (fma t_1 t_1 1.0)))
ew
(* eh (* (cos t) (sin (atan t_1))))))
(fabs
(*
ew
(fma
eh
(/ (* (cos t) (sin (atan (/ eh (* ew (tan t)))))) ew)
(sin t)))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
double tmp;
if (t <= 8.2e+99) {
tmp = fabs(fma((sin(t) / sqrt(fma(t_1, t_1, 1.0))), ew, (eh * (cos(t) * sin(atan(t_1))))));
} else {
tmp = fabs((ew * fma(eh, ((cos(t) * sin(atan((eh / (ew * tan(t)))))) / ew), sin(t))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * t)) tmp = 0.0 if (t <= 8.2e+99) tmp = abs(fma(Float64(sin(t) / sqrt(fma(t_1, t_1, 1.0))), ew, Float64(eh * Float64(cos(t) * sin(atan(t_1)))))); else tmp = abs(Float64(ew * fma(eh, Float64(Float64(cos(t) * sin(atan(Float64(eh / Float64(ew * tan(t)))))) / ew), sin(t)))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 8.2e+99], N[Abs[N[(N[(N[Sin[t], $MachinePrecision] / N[Sqrt[N[(t$95$1 * t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(eh * N[(N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
\mathbf{if}\;t \leq 8.2 \cdot 10^{+99}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{\sin t}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}, ew, eh \cdot \left(\cos t \cdot \sin \tan^{-1} t\_1\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \mathsf{fma}\left(eh, \frac{\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}{ew}, \sin t\right)\right|\\
\end{array}
\end{array}
if t < 8.19999999999999959e99Initial program 99.9%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.2
Applied rewrites99.2%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6496.3
Applied rewrites96.3%
if 8.19999999999999959e99 < t Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites88.8%
Taylor expanded in ew around inf
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites88.4%
Final simplification94.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew t))))
(fabs
(fma
(/ (sin t) (sqrt (fma t_1 t_1 1.0)))
ew
(* eh (* (cos t) (sin (atan t_1))))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
return fabs(fma((sin(t) / sqrt(fma(t_1, t_1, 1.0))), ew, (eh * (cos(t) * sin(atan(t_1))))));
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * t)) return abs(fma(Float64(sin(t) / sqrt(fma(t_1, t_1, 1.0))), ew, Float64(eh * Float64(cos(t) * sin(atan(t_1)))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t], $MachinePrecision] / N[Sqrt[N[(t$95$1 * t$95$1 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(eh * N[(N[Cos[t], $MachinePrecision] * N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
\left|\mathsf{fma}\left(\frac{\sin t}{\sqrt{\mathsf{fma}\left(t\_1, t\_1, 1\right)}}, ew, eh \cdot \left(\cos t \cdot \sin \tan^{-1} t\_1\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.1
Applied rewrites99.1%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.1%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6491.0
Applied rewrites91.0%
Final simplification91.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (sin t))))
(if (<= ew -2.2e+140)
(fabs (fma (/ 0.5 t_1) (* eh eh) t_1))
(if (<= ew 1.25e+97) (fabs (* eh (cos t))) (fabs t_1)))))
double code(double eh, double ew, double t) {
double t_1 = ew * sin(t);
double tmp;
if (ew <= -2.2e+140) {
tmp = fabs(fma((0.5 / t_1), (eh * eh), t_1));
} else if (ew <= 1.25e+97) {
tmp = fabs((eh * cos(t)));
} else {
tmp = fabs(t_1);
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(ew * sin(t)) tmp = 0.0 if (ew <= -2.2e+140) tmp = abs(fma(Float64(0.5 / t_1), Float64(eh * eh), t_1)); elseif (ew <= 1.25e+97) tmp = abs(Float64(eh * cos(t))); else tmp = abs(t_1); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, -2.2e+140], N[Abs[N[(N[(0.5 / t$95$1), $MachinePrecision] * N[(eh * eh), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.25e+97], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[t$95$1], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \sin t\\
\mathbf{if}\;ew \leq -2.2 \cdot 10^{+140}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{0.5}{t\_1}, eh \cdot eh, t\_1\right)\right|\\
\mathbf{elif}\;ew \leq 1.25 \cdot 10^{+97}:\\
\;\;\;\;\left|eh \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if ew < -2.1999999999999998e140Initial program 99.7%
Applied rewrites79.4%
Taylor expanded in eh around 0
lower-fma.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6475.9
Applied rewrites75.9%
Applied rewrites75.9%
Taylor expanded in t around 0
Applied rewrites75.9%
if -2.1999999999999998e140 < ew < 1.25e97Initial program 99.8%
Applied rewrites30.4%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-cos.f6480.6
Applied rewrites80.6%
if 1.25e97 < ew Initial program 99.9%
Applied rewrites80.2%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6478.7
Applied rewrites78.7%
Final simplification79.6%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (fabs (* ew (sin t))))) (if (<= ew -2.2e+140) t_1 (if (<= ew 1.25e+97) (fabs (* eh (cos t))) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((ew * sin(t)));
double tmp;
if (ew <= -2.2e+140) {
tmp = t_1;
} else if (ew <= 1.25e+97) {
tmp = fabs((eh * cos(t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(eh, ew, t)
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = abs((ew * sin(t)))
if (ew <= (-2.2d+140)) then
tmp = t_1
else if (ew <= 1.25d+97) then
tmp = abs((eh * cos(t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.abs((ew * Math.sin(t)));
double tmp;
if (ew <= -2.2e+140) {
tmp = t_1;
} else if (ew <= 1.25e+97) {
tmp = Math.abs((eh * Math.cos(t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((ew * math.sin(t))) tmp = 0 if ew <= -2.2e+140: tmp = t_1 elif ew <= 1.25e+97: tmp = math.fabs((eh * math.cos(t))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(ew * sin(t))) tmp = 0.0 if (ew <= -2.2e+140) tmp = t_1; elseif (ew <= 1.25e+97) tmp = abs(Float64(eh * cos(t))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((ew * sin(t))); tmp = 0.0; if (ew <= -2.2e+140) tmp = t_1; elseif (ew <= 1.25e+97) tmp = abs((eh * cos(t))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.2e+140], t$95$1, If[LessEqual[ew, 1.25e+97], N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|ew \cdot \sin t\right|\\
\mathbf{if}\;ew \leq -2.2 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 1.25 \cdot 10^{+97}:\\
\;\;\;\;\left|eh \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -2.1999999999999998e140 or 1.25e97 < ew Initial program 99.8%
Applied rewrites79.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6477.2
Applied rewrites77.2%
if -2.1999999999999998e140 < ew < 1.25e97Initial program 99.8%
Applied rewrites30.4%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-cos.f6480.6
Applied rewrites80.6%
(FPCore (eh ew t) :precision binary64 (fabs (* eh (cos t))))
double code(double eh, double ew, double t) {
return fabs((eh * cos(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)))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((eh * Math.cos(t)));
}
def code(eh, ew, t): return math.fabs((eh * math.cos(t)))
function code(eh, ew, t) return abs(Float64(eh * cos(t))) end
function tmp = code(eh, ew, t) tmp = abs((eh * cos(t))); end
code[eh_, ew_, t_] := N[Abs[N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot \cos t\right|
\end{array}
Initial program 99.8%
Applied rewrites46.6%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-cos.f6463.1
Applied rewrites63.1%
(FPCore (eh ew t) :precision binary64 (fabs (* eh 1.0)))
double code(double eh, double ew, double t) {
return fabs((eh * 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((eh * 1.0d0))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((eh * 1.0));
}
def code(eh, ew, t): return math.fabs((eh * 1.0))
function code(eh, ew, t) return abs(Float64(eh * 1.0)) end
function tmp = code(eh, ew, t) tmp = abs((eh * 1.0)); end
code[eh_, ew_, t_] := N[Abs[N[(eh * 1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|eh \cdot 1\right|
\end{array}
Initial program 99.8%
Applied rewrites46.6%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-cos.f6463.1
Applied rewrites63.1%
Taylor expanded in t around 0
Applied rewrites43.1%
herbie shell --seed 2024237
(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))))))))