
(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))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(eh, ew, t)
use fmin_fmax_functions
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}
Herbie found 12 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))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(eh, ew, t)
use fmin_fmax_functions
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 (asinh (/ eh (* (tan t) ew))))) (fabs (fma (/ (sin t) (cosh t_1)) ew (* (tanh t_1) (* (cos t) eh))))))
double code(double eh, double ew, double t) {
double t_1 = asinh((eh / (tan(t) * ew)));
return fabs(fma((sin(t) / cosh(t_1)), ew, (tanh(t_1) * (cos(t) * eh))));
}
function code(eh, ew, t) t_1 = asinh(Float64(eh / Float64(tan(t) * ew))) return abs(fma(Float64(sin(t) / cosh(t_1)), ew, Float64(tanh(t_1) * Float64(cos(t) * eh)))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t], $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision] * ew + N[(N[Tanh[t$95$1], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\\
\left|\mathsf{fma}\left(\frac{\sin t}{\cosh t\_1}, ew, \tanh t\_1 \cdot \left(\cos t \cdot eh\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Applied rewrites99.8%
(FPCore (eh ew t) :precision binary64 (fabs (fma (sin t) ew (* (tanh (asinh (/ eh (* (tan t) ew)))) (* (cos t) eh)))))
double code(double eh, double ew, double t) {
return fabs(fma(sin(t), ew, (tanh(asinh((eh / (tan(t) * ew)))) * (cos(t) * eh))));
}
function code(eh, ew, t) return abs(fma(sin(t), ew, Float64(tanh(asinh(Float64(eh / Float64(tan(t) * ew)))) * Float64(cos(t) * eh)))) end
code[eh_, ew_, t_] := N[Abs[N[(N[Sin[t], $MachinePrecision] * ew + N[(N[Tanh[N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(\sin t, ew, \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot \left(\cos t \cdot eh\right)\right)\right|
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-sin.f6498.7
Applied rewrites98.7%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (asinh (/ eh (* ew t))))) (fabs (fma (/ (sin t) (cosh t_1)) ew (* (tanh t_1) (* (cos t) eh))))))
double code(double eh, double ew, double t) {
double t_1 = asinh((eh / (ew * t)));
return fabs(fma((sin(t) / cosh(t_1)), ew, (tanh(t_1) * (cos(t) * eh))));
}
function code(eh, ew, t) t_1 = asinh(Float64(eh / Float64(ew * t))) return abs(fma(Float64(sin(t) / cosh(t_1)), ew, Float64(tanh(t_1) * Float64(cos(t) * eh)))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t], $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision] * ew + N[(N[Tanh[t$95$1], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right)\\
\left|\mathsf{fma}\left(\frac{\sin t}{\cosh t\_1}, ew, \tanh t\_1 \cdot \left(\cos t \cdot eh\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in t around 0
lower-*.f6499.2
Applied rewrites99.2%
Taylor expanded in t around 0
lower-*.f6489.9
Applied rewrites89.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew t)))
(t_2 (* (cos t) eh))
(t_3 (fabs (* t_2 (tanh (asinh (/ eh (* (tan t) ew))))))))
(if (<= eh -1.7e-54)
t_3
(if (<= eh 4.2e+72)
(fabs (/ (fma t_1 t_2 (* (sin t) ew)) (cosh (asinh t_1))))
t_3))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
double t_2 = cos(t) * eh;
double t_3 = fabs((t_2 * tanh(asinh((eh / (tan(t) * ew))))));
double tmp;
if (eh <= -1.7e-54) {
tmp = t_3;
} else if (eh <= 4.2e+72) {
tmp = fabs((fma(t_1, t_2, (sin(t) * ew)) / cosh(asinh(t_1))));
} else {
tmp = t_3;
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * t)) t_2 = Float64(cos(t) * eh) t_3 = abs(Float64(t_2 * tanh(asinh(Float64(eh / Float64(tan(t) * ew)))))) tmp = 0.0 if (eh <= -1.7e-54) tmp = t_3; elseif (eh <= 4.2e+72) tmp = abs(Float64(fma(t_1, t_2, Float64(sin(t) * ew)) / cosh(asinh(t_1)))); else tmp = t_3; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(t$95$2 * N[Tanh[N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.7e-54], t$95$3, If[LessEqual[eh, 4.2e+72], N[Abs[N[(N[(t$95$1 * t$95$2 + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
t_2 := \cos t \cdot eh\\
t_3 := \left|t\_2 \cdot \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right|\\
\mathbf{if}\;eh \leq -1.7 \cdot 10^{-54}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eh \leq 4.2 \cdot 10^{+72}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(t\_1, t\_2, \sin t \cdot ew\right)}{\cosh \sinh^{-1} t\_1}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if eh < -1.69999999999999994e-54 or 4.2000000000000003e72 < eh Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Taylor expanded in ew around 0
lower-pow.f64N/A
Applied rewrites30.7%
Applied rewrites62.2%
if -1.69999999999999994e-54 < eh < 4.2000000000000003e72Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*l/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
cos-atanN/A
Applied rewrites62.3%
Taylor expanded in t around 0
lower-*.f6450.8
Applied rewrites50.8%
Taylor expanded in t around 0
lower-*.f6458.0
Applied rewrites58.0%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew t)))
(t_2
(/
(fabs (* (- (pow t_1 2.0) -1.0) (* (sin t) ew)))
(cosh (asinh t_1)))))
(if (<= ew -4.2e+171)
t_2
(if (<= ew 3.3e+53)
(fabs (* (* (cos t) eh) (tanh (asinh (/ eh (* (tan t) ew))))))
t_2))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * t);
double t_2 = fabs(((pow(t_1, 2.0) - -1.0) * (sin(t) * ew))) / cosh(asinh(t_1));
double tmp;
if (ew <= -4.2e+171) {
tmp = t_2;
} else if (ew <= 3.3e+53) {
tmp = fabs(((cos(t) * eh) * tanh(asinh((eh / (tan(t) * ew))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(eh, ew, t): t_1 = eh / (ew * t) t_2 = math.fabs(((math.pow(t_1, 2.0) - -1.0) * (math.sin(t) * ew))) / math.cosh(math.asinh(t_1)) tmp = 0 if ew <= -4.2e+171: tmp = t_2 elif ew <= 3.3e+53: tmp = math.fabs(((math.cos(t) * eh) * math.tanh(math.asinh((eh / (math.tan(t) * ew)))))) else: tmp = t_2 return tmp
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * t)) t_2 = Float64(abs(Float64(Float64((t_1 ^ 2.0) - -1.0) * Float64(sin(t) * ew))) / cosh(asinh(t_1))) tmp = 0.0 if (ew <= -4.2e+171) tmp = t_2; elseif (ew <= 3.3e+53) tmp = abs(Float64(Float64(cos(t) * eh) * tanh(asinh(Float64(eh / Float64(tan(t) * ew)))))); else tmp = t_2; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = eh / (ew * t); t_2 = abs((((t_1 ^ 2.0) - -1.0) * (sin(t) * ew))) / cosh(asinh(t_1)); tmp = 0.0; if (ew <= -4.2e+171) tmp = t_2; elseif (ew <= 3.3e+53) tmp = abs(((cos(t) * eh) * tanh(asinh((eh / (tan(t) * ew)))))); else tmp = t_2; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] - -1.0), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, -4.2e+171], t$95$2, If[LessEqual[ew, 3.3e+53], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Tanh[N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot t}\\
t_2 := \frac{\left|\left({t\_1}^{2} - -1\right) \cdot \left(\sin t \cdot ew\right)\right|}{\cosh \sinh^{-1} t\_1}\\
\mathbf{if}\;ew \leq -4.2 \cdot 10^{+171}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ew \leq 3.3 \cdot 10^{+53}:\\
\;\;\;\;\left|\left(\cos t \cdot eh\right) \cdot \tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if ew < -4.2000000000000003e171 or 3.3000000000000002e53 < ew Initial program 99.8%
Applied rewrites99.8%
Applied rewrites56.4%
Taylor expanded in t around 0
lower-*.f6447.8
Applied rewrites47.8%
Taylor expanded in t around 0
lower-*.f6448.2
Applied rewrites48.2%
if -4.2000000000000003e171 < ew < 3.3000000000000002e53Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Taylor expanded in ew around 0
lower-pow.f64N/A
Applied rewrites30.7%
Applied rewrites62.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(*
(tanh
(asinh (/ (/ (fma (* (* t t) eh) -0.3333333333333333 eh) ew) t)))
eh)))
(t_2 (/ eh (* ew t))))
(if (<= eh -1.7e-54)
t_1
(if (<= eh 8.6e+52)
(/ (fabs (* (- (pow t_2 2.0) -1.0) (* (sin t) ew))) (cosh (asinh t_2)))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((tanh(asinh(((fma(((t * t) * eh), -0.3333333333333333, eh) / ew) / t))) * eh));
double t_2 = eh / (ew * t);
double tmp;
if (eh <= -1.7e-54) {
tmp = t_1;
} else if (eh <= 8.6e+52) {
tmp = fabs(((pow(t_2, 2.0) - -1.0) * (sin(t) * ew))) / cosh(asinh(t_2));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(Float64(tanh(asinh(Float64(Float64(fma(Float64(Float64(t * t) * eh), -0.3333333333333333, eh) / ew) / t))) * eh)) t_2 = Float64(eh / Float64(ew * t)) tmp = 0.0 if (eh <= -1.7e-54) tmp = t_1; elseif (eh <= 8.6e+52) tmp = Float64(abs(Float64(Float64((t_2 ^ 2.0) - -1.0) * Float64(sin(t) * ew))) / cosh(asinh(t_2))); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Tanh[N[ArcSinh[N[(N[(N[(N[(N[(t * t), $MachinePrecision] * eh), $MachinePrecision] * -0.3333333333333333 + eh), $MachinePrecision] / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, -1.7e-54], t$95$1, If[LessEqual[eh, 8.6e+52], N[(N[Abs[N[(N[(N[Power[t$95$2, 2.0], $MachinePrecision] - -1.0), $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\tanh \sinh^{-1} \left(\frac{\frac{\mathsf{fma}\left(\left(t \cdot t\right) \cdot eh, -0.3333333333333333, eh\right)}{ew}}{t}\right) \cdot eh\right|\\
t_2 := \frac{eh}{ew \cdot t}\\
\mathbf{if}\;eh \leq -1.7 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 8.6 \cdot 10^{+52}:\\
\;\;\;\;\frac{\left|\left({t\_2}^{2} - -1\right) \cdot \left(\sin t \cdot ew\right)\right|}{\cosh \sinh^{-1} t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -1.69999999999999994e-54 or 8.5999999999999999e52 < eh Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6418.7
Applied rewrites18.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6420.1
Applied rewrites20.1%
Applied rewrites42.4%
if -1.69999999999999994e-54 < eh < 8.5999999999999999e52Initial program 99.8%
Applied rewrites99.8%
Applied rewrites56.4%
Taylor expanded in t around 0
lower-*.f6447.8
Applied rewrites47.8%
Taylor expanded in t around 0
lower-*.f6448.2
Applied rewrites48.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin t) ew))))
(if (<= t -1.4e-51)
t_1
(if (<= t 4.3e-45)
(fabs
(*
(tanh
(asinh (/ (/ (fma (* (* t t) eh) -0.3333333333333333 eh) ew) t)))
eh))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * ew));
double tmp;
if (t <= -1.4e-51) {
tmp = t_1;
} else if (t <= 4.3e-45) {
tmp = fabs((tanh(asinh(((fma(((t * t) * eh), -0.3333333333333333, eh) / ew) / t))) * eh));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(Float64(sin(t) * ew)) tmp = 0.0 if (t <= -1.4e-51) tmp = t_1; elseif (t <= 4.3e-45) tmp = abs(Float64(tanh(asinh(Float64(Float64(fma(Float64(Float64(t * t) * eh), -0.3333333333333333, eh) / ew) / t))) * eh)); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.4e-51], t$95$1, If[LessEqual[t, 4.3e-45], N[Abs[N[(N[Tanh[N[ArcSinh[N[(N[(N[(N[(N[(t * t), $MachinePrecision] * eh), $MachinePrecision] * -0.3333333333333333 + eh), $MachinePrecision] / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin t \cdot ew\right|\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-45}:\\
\;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{\frac{\mathsf{fma}\left(\left(t \cdot t\right) \cdot eh, -0.3333333333333333, eh\right)}{ew}}{t}\right) \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.4e-51 or 4.2999999999999999e-45 < t Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6441.3
Applied rewrites41.3%
if -1.4e-51 < t < 4.2999999999999999e-45Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6418.7
Applied rewrites18.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6420.1
Applied rewrites20.1%
Applied rewrites42.4%
(FPCore (eh ew t)
:precision binary64
(if (<= eh -1.12e+104)
(*
(tanh (asinh (/ (/ (fma (* (* t t) eh) -0.3333333333333333 eh) ew) t)))
eh)
(if (<= eh 1.45e+86)
(fabs (* (sin t) ew))
(* (tanh (asinh (/ eh (* ew t)))) eh))))
double code(double eh, double ew, double t) {
double tmp;
if (eh <= -1.12e+104) {
tmp = tanh(asinh(((fma(((t * t) * eh), -0.3333333333333333, eh) / ew) / t))) * eh;
} else if (eh <= 1.45e+86) {
tmp = fabs((sin(t) * ew));
} else {
tmp = tanh(asinh((eh / (ew * t)))) * eh;
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (eh <= -1.12e+104) tmp = Float64(tanh(asinh(Float64(Float64(fma(Float64(Float64(t * t) * eh), -0.3333333333333333, eh) / ew) / t))) * eh); elseif (eh <= 1.45e+86) tmp = abs(Float64(sin(t) * ew)); else tmp = Float64(tanh(asinh(Float64(eh / Float64(ew * t)))) * eh); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[eh, -1.12e+104], N[(N[Tanh[N[ArcSinh[N[(N[(N[(N[(N[(t * t), $MachinePrecision] * eh), $MachinePrecision] * -0.3333333333333333 + eh), $MachinePrecision] / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision], If[LessEqual[eh, 1.45e+86], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[(N[Tanh[N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;eh \leq -1.12 \cdot 10^{+104}:\\
\;\;\;\;\tanh \sinh^{-1} \left(\frac{\frac{\mathsf{fma}\left(\left(t \cdot t\right) \cdot eh, -0.3333333333333333, eh\right)}{ew}}{t}\right) \cdot eh\\
\mathbf{elif}\;eh \leq 1.45 \cdot 10^{+86}:\\
\;\;\;\;\left|\sin t \cdot ew\right|\\
\mathbf{else}:\\
\;\;\;\;\tanh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\\
\end{array}
\end{array}
if eh < -1.12000000000000003e104Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6418.7
Applied rewrites18.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6420.1
Applied rewrites20.1%
Applied rewrites22.0%
if -1.12000000000000003e104 < eh < 1.44999999999999995e86Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6441.3
Applied rewrites41.3%
if 1.44999999999999995e86 < eh Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Applied rewrites21.7%
Taylor expanded in t around 0
lower-*.f6420.9
Applied rewrites20.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin t) ew))))
(if (<= t -1.2e-111)
t_1
(if (<= t 7.2e-167) (* (tanh (asinh (/ eh (* ew t)))) eh) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * ew));
double tmp;
if (t <= -1.2e-111) {
tmp = t_1;
} else if (t <= 7.2e-167) {
tmp = tanh(asinh((eh / (ew * t)))) * eh;
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(t) * ew)) tmp = 0 if t <= -1.2e-111: tmp = t_1 elif t <= 7.2e-167: tmp = math.tanh(math.asinh((eh / (ew * t)))) * eh else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(t) * ew)) tmp = 0.0 if (t <= -1.2e-111) tmp = t_1; elseif (t <= 7.2e-167) tmp = Float64(tanh(asinh(Float64(eh / Float64(ew * 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 (t <= -1.2e-111) tmp = t_1; elseif (t <= 7.2e-167) tmp = tanh(asinh((eh / (ew * 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[t, -1.2e-111], t$95$1, If[LessEqual[t, 7.2e-167], N[(N[Tanh[N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin t \cdot ew\right|\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-167}:\\
\;\;\;\;\tanh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.2e-111 or 7.2000000000000002e-167 < t Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.3
Applied rewrites41.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6441.3
Applied rewrites41.3%
if -1.2e-111 < t < 7.2000000000000002e-167Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Applied rewrites21.7%
Taylor expanded in t around 0
lower-*.f6420.9
Applied rewrites20.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* t (+ ew (* -0.16666666666666666 (* ew (pow t 2.0))))))))
(if (<= ew -2.9e+85)
t_1
(if (<= ew 6.2e+50) (* (tanh (asinh (/ eh (* ew t)))) eh) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((t * (ew + (-0.16666666666666666 * (ew * pow(t, 2.0))))));
double tmp;
if (ew <= -2.9e+85) {
tmp = t_1;
} else if (ew <= 6.2e+50) {
tmp = tanh(asinh((eh / (ew * t)))) * eh;
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((t * (ew + (-0.16666666666666666 * (ew * math.pow(t, 2.0)))))) tmp = 0 if ew <= -2.9e+85: tmp = t_1 elif ew <= 6.2e+50: tmp = math.tanh(math.asinh((eh / (ew * t)))) * eh else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(t * Float64(ew + Float64(-0.16666666666666666 * Float64(ew * (t ^ 2.0)))))) tmp = 0.0 if (ew <= -2.9e+85) tmp = t_1; elseif (ew <= 6.2e+50) tmp = Float64(tanh(asinh(Float64(eh / Float64(ew * t)))) * eh); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = abs((t * (ew + (-0.16666666666666666 * (ew * (t ^ 2.0)))))); tmp = 0.0; if (ew <= -2.9e+85) tmp = t_1; elseif (ew <= 6.2e+50) tmp = tanh(asinh((eh / (ew * t)))) * eh; else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(t * N[(ew + N[(-0.16666666666666666 * N[(ew * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.9e+85], t$95$1, If[LessEqual[ew, 6.2e+50], N[(N[Tanh[N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|t \cdot \left(ew + -0.16666666666666666 \cdot \left(ew \cdot {t}^{2}\right)\right)\right|\\
\mathbf{if}\;ew \leq -2.9 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 6.2 \cdot 10^{+50}:\\
\;\;\;\;\tanh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -2.89999999999999997e85 or 6.20000000000000006e50 < ew Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.3
Applied rewrites41.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6418.5
Applied rewrites18.5%
if -2.89999999999999997e85 < ew < 6.20000000000000006e50Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Applied rewrites21.7%
Taylor expanded in t around 0
lower-*.f6420.9
Applied rewrites20.9%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (* (tanh (asinh (/ eh (* ew t)))) eh))) (if (<= eh -2.8e-127) t_1 (if (<= eh 1.15e+86) (fabs (* ew t)) t_1))))
double code(double eh, double ew, double t) {
double t_1 = tanh(asinh((eh / (ew * t)))) * eh;
double tmp;
if (eh <= -2.8e-127) {
tmp = t_1;
} else if (eh <= 1.15e+86) {
tmp = fabs((ew * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.tanh(math.asinh((eh / (ew * t)))) * eh tmp = 0 if eh <= -2.8e-127: tmp = t_1 elif eh <= 1.15e+86: tmp = math.fabs((ew * t)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(tanh(asinh(Float64(eh / Float64(ew * t)))) * eh) tmp = 0.0 if (eh <= -2.8e-127) tmp = t_1; elseif (eh <= 1.15e+86) tmp = abs(Float64(ew * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = tanh(asinh((eh / (ew * t)))) * eh; tmp = 0.0; if (eh <= -2.8e-127) tmp = t_1; elseif (eh <= 1.15e+86) tmp = abs((ew * t)); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Tanh[N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, -2.8e-127], t$95$1, If[LessEqual[eh, 1.15e+86], N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tanh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\\
\mathbf{if}\;eh \leq -2.8 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 1.15 \cdot 10^{+86}:\\
\;\;\;\;\left|ew \cdot t\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -2.8e-127 or 1.14999999999999995e86 < eh Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6442.2
Applied rewrites42.2%
Applied rewrites21.0%
Applied rewrites21.7%
Taylor expanded in t around 0
lower-*.f6420.9
Applied rewrites20.9%
if -2.8e-127 < eh < 1.14999999999999995e86Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.3
Applied rewrites41.3%
Taylor expanded in t around 0
Applied rewrites18.8%
(FPCore (eh ew t) :precision binary64 (fabs (* ew t)))
double code(double eh, double ew, double t) {
return fabs((ew * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * t))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * t));
}
def code(eh, ew, t): return math.fabs((ew * t))
function code(eh, ew, t) return abs(Float64(ew * t)) end
function tmp = code(eh, ew, t) tmp = abs((ew * t)); end
code[eh_, ew_, t_] := N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot t\right|
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.3
Applied rewrites41.3%
Taylor expanded in t around 0
Applied rewrites18.8%
herbie shell --seed 2025162
(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))))))))