
(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 14 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 eh (* (tanh t_1) (cos t)) (* ew (* (/ 1.0 (cosh t_1)) (sin t)))))))
double code(double eh, double ew, double t) {
double t_1 = asinh((eh / (tan(t) * ew)));
return fabs(fma(eh, (tanh(t_1) * cos(t)), (ew * ((1.0 / cosh(t_1)) * sin(t)))));
}
function code(eh, ew, t) t_1 = asinh(Float64(eh / Float64(tan(t) * ew))) return abs(fma(eh, Float64(tanh(t_1) * cos(t)), Float64(ew * Float64(Float64(1.0 / cosh(t_1)) * sin(t))))) 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[(eh * N[(N[Tanh[t$95$1], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(ew * N[(N[(1.0 / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $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(eh, \tanh t\_1 \cdot \cos t, ew \cdot \left(\frac{1}{\cosh t\_1} \cdot \sin t\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in eh around 0
lower-fma.f64N/A
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flipN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flipN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
tanh-asinh-revN/A
lift-asinh.f64N/A
lower-tanh.f6499.8
Applied rewrites99.8%
lift-cos.f64N/A
lift-atan.f64N/A
cos-atanN/A
+-commutativeN/A
cosh-asinhN/A
lift-/.f64N/A
lift-*.f64N/A
lift-tan.f64N/A
lower-/.f64N/A
lift-tan.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-asinh.f64N/A
lower-cosh.f6499.8
Applied rewrites99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (asinh (/ eh (* (tan t) ew))))) (fabs (fma (* (tanh t_1) (cos t)) eh (/ (* (sin t) ew) (cosh t_1))))))
double code(double eh, double ew, double t) {
double t_1 = asinh((eh / (tan(t) * ew)));
return fabs(fma((tanh(t_1) * cos(t)), eh, ((sin(t) * ew) / cosh(t_1))));
}
function code(eh, ew, t) t_1 = asinh(Float64(eh / Float64(tan(t) * ew))) return abs(fma(Float64(tanh(t_1) * cos(t)), eh, Float64(Float64(sin(t) * ew) / cosh(t_1)))) 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[Tanh[t$95$1], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * eh + N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] / N[Cosh[t$95$1], $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(\tanh t\_1 \cdot \cos t, eh, \frac{\sin t \cdot ew}{\cosh t\_1}\right)\right|
\end{array}
\end{array}
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
Applied rewrites99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (asinh (/ (/ (fma (* (* t t) eh) -0.3333333333333333 eh) ew) t)))
(t_2 (/ eh (* t ew))))
(if (<= eh 7.8e-90)
(fabs
(fma
eh
(* (tanh (asinh t_2)) (cos t))
(* ew (* (cos (atan t_2)) (sin t)))))
(fabs (fma (* (cos t) eh) (tanh t_1) (/ (* (sin t) ew) (cosh t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = asinh(((fma(((t * t) * eh), -0.3333333333333333, eh) / ew) / t));
double t_2 = eh / (t * ew);
double tmp;
if (eh <= 7.8e-90) {
tmp = fabs(fma(eh, (tanh(asinh(t_2)) * cos(t)), (ew * (cos(atan(t_2)) * sin(t)))));
} else {
tmp = fabs(fma((cos(t) * eh), tanh(t_1), ((sin(t) * ew) / cosh(t_1))));
}
return tmp;
}
function code(eh, ew, t) t_1 = asinh(Float64(Float64(fma(Float64(Float64(t * t) * eh), -0.3333333333333333, eh) / ew) / t)) t_2 = Float64(eh / Float64(t * ew)) tmp = 0.0 if (eh <= 7.8e-90) tmp = abs(fma(eh, Float64(tanh(asinh(t_2)) * cos(t)), Float64(ew * Float64(cos(atan(t_2)) * sin(t))))); else tmp = abs(fma(Float64(cos(t) * eh), tanh(t_1), Float64(Float64(sin(t) * ew) / cosh(t_1)))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(N[(N[(N[(N[(t * t), $MachinePrecision] * eh), $MachinePrecision] * -0.3333333333333333 + eh), $MachinePrecision] / ew), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, 7.8e-90], N[Abs[N[(eh * N[(N[Tanh[N[ArcSinh[t$95$2], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(ew * N[(N[Cos[N[ArcTan[t$95$2], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Tanh[t$95$1], $MachinePrecision] + N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{\frac{\mathsf{fma}\left(\left(t \cdot t\right) \cdot eh, -0.3333333333333333, eh\right)}{ew}}{t}\right)\\
t_2 := \frac{eh}{t \cdot ew}\\
\mathbf{if}\;eh \leq 7.8 \cdot 10^{-90}:\\
\;\;\;\;\left|\mathsf{fma}\left(eh, \tanh \sinh^{-1} t\_2 \cdot \cos t, ew \cdot \left(\cos \tan^{-1} t\_2 \cdot \sin t\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(\cos t \cdot eh, \tanh t\_1, \frac{\sin t \cdot ew}{\cosh t\_1}\right)\right|\\
\end{array}
\end{array}
if eh < 7.80000000000000009e-90Initial program 99.8%
Taylor expanded in eh around 0
lower-fma.f64N/A
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flipN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flipN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
tanh-asinh-revN/A
lift-asinh.f64N/A
lower-tanh.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
Applied rewrites89.9%
Taylor expanded in t around 0
Applied rewrites89.9%
if 7.80000000000000009e-90 < eh Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6437.2
Applied rewrites37.2%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6440.7
Applied rewrites40.7%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
Applied rewrites84.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* t ew))))
(fabs
(fma
eh
(* (tanh (asinh t_1)) (cos t))
(* ew (* (cos (atan t_1)) (sin t)))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (t * ew);
return fabs(fma(eh, (tanh(asinh(t_1)) * cos(t)), (ew * (cos(atan(t_1)) * sin(t)))));
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(t * ew)) return abs(fma(eh, Float64(tanh(asinh(t_1)) * cos(t)), Float64(ew * Float64(cos(atan(t_1)) * sin(t))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(eh * N[(N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] + N[(ew * N[(N[Cos[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{t \cdot ew}\\
\left|\mathsf{fma}\left(eh, \tanh \sinh^{-1} t\_1 \cdot \cos t, ew \cdot \left(\cos \tan^{-1} t\_1 \cdot \sin t\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in eh around 0
lower-fma.f64N/A
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flipN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flipN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
tanh-asinh-revN/A
lift-asinh.f64N/A
lower-tanh.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
Applied rewrites89.9%
Taylor expanded in t around 0
Applied rewrites89.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) eh))
(t_2 (* (sin t) ew))
(t_3 (/ eh (* t ew)))
(t_4 (sqrt (fma t_3 t_3 1.0))))
(if (<= t -3.2e-73)
(fabs
(/ (fma eh (* (/ 1.0 (* ew t)) t_1) t_2) (cosh (asinh (/ eh (* ew t))))))
(if (<= t 3e-137)
(fabs
(*
eh
(sin
(atan
(/
(* eh (cos t))
(* ew (* t (+ 1.0 (* -0.16666666666666666 (pow t 2.0))))))))))
(fabs (fma t_3 (/ t_1 t_4) (/ t_2 t_4)))))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * eh;
double t_2 = sin(t) * ew;
double t_3 = eh / (t * ew);
double t_4 = sqrt(fma(t_3, t_3, 1.0));
double tmp;
if (t <= -3.2e-73) {
tmp = fabs((fma(eh, ((1.0 / (ew * t)) * t_1), t_2) / cosh(asinh((eh / (ew * t))))));
} else if (t <= 3e-137) {
tmp = fabs((eh * sin(atan(((eh * cos(t)) / (ew * (t * (1.0 + (-0.16666666666666666 * pow(t, 2.0))))))))));
} else {
tmp = fabs(fma(t_3, (t_1 / t_4), (t_2 / t_4)));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(cos(t) * eh) t_2 = Float64(sin(t) * ew) t_3 = Float64(eh / Float64(t * ew)) t_4 = sqrt(fma(t_3, t_3, 1.0)) tmp = 0.0 if (t <= -3.2e-73) tmp = abs(Float64(fma(eh, Float64(Float64(1.0 / Float64(ew * t)) * t_1), t_2) / cosh(asinh(Float64(eh / Float64(ew * t)))))); elseif (t <= 3e-137) tmp = abs(Float64(eh * sin(atan(Float64(Float64(eh * cos(t)) / Float64(ew * Float64(t * Float64(1.0 + Float64(-0.16666666666666666 * (t ^ 2.0)))))))))); else tmp = abs(fma(t_3, Float64(t_1 / t_4), Float64(t_2 / t_4))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(t$95$3 * t$95$3 + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.2e-73], N[Abs[N[(N[(eh * N[(N[(1.0 / N[(ew * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 3e-137], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[(ew * N[(t * N[(1.0 + N[(-0.16666666666666666 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$3 * N[(t$95$1 / t$95$4), $MachinePrecision] + N[(t$95$2 / t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot eh\\
t_2 := \sin t \cdot ew\\
t_3 := \frac{eh}{t \cdot ew}\\
t_4 := \sqrt{\mathsf{fma}\left(t\_3, t\_3, 1\right)}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{-73}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(eh, \frac{1}{ew \cdot t} \cdot t\_1, t\_2\right)}{\cosh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right)}\right|\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-137}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \cos t}{ew \cdot \left(t \cdot \left(1 + -0.16666666666666666 \cdot {t}^{2}\right)\right)}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(t\_3, \frac{t\_1}{t\_4}, \frac{t\_2}{t\_4}\right)\right|\\
\end{array}
\end{array}
if t < -3.19999999999999986e-73Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
Applied rewrites61.8%
Taylor expanded in t around 0
lower-*.f6450.7
Applied rewrites50.7%
Taylor expanded in t around 0
lower-*.f6457.5
Applied rewrites57.5%
if -3.19999999999999986e-73 < t < 2.9999999999999998e-137Initial 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.f6441.5
Applied rewrites41.5%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6437.5
Applied rewrites37.5%
if 2.9999999999999998e-137 < t Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
Applied rewrites61.8%
Taylor expanded in t around 0
lower-*.f6450.7
Applied rewrites50.7%
Taylor expanded in t around 0
lower-*.f6457.5
Applied rewrites57.5%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
Applied rewrites57.2%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1
(fabs
(* eh (sin (atan (/ (* eh (sin (fma PI 0.5 t))) (* ew (sin t)))))))))
(if (<= eh -2.7e+88)
t_1
(if (<= eh 270000.0)
(fabs
(/
(fma (/ (* (cos t) eh) (* t ew)) eh (* (sin t) ew))
(cosh (asinh (/ eh (* ew t))))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((eh * sin(atan(((eh * sin(fma(((double) M_PI), 0.5, t))) / (ew * sin(t)))))));
double tmp;
if (eh <= -2.7e+88) {
tmp = t_1;
} else if (eh <= 270000.0) {
tmp = fabs((fma(((cos(t) * eh) / (t * ew)), eh, (sin(t) * ew)) / cosh(asinh((eh / (ew * t))))));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(Float64(eh * sin(atan(Float64(Float64(eh * sin(fma(pi, 0.5, t))) / Float64(ew * sin(t))))))) tmp = 0.0 if (eh <= -2.7e+88) tmp = t_1; elseif (eh <= 270000.0) tmp = abs(Float64(fma(Float64(Float64(cos(t) * eh) / Float64(t * ew)), eh, Float64(sin(t) * ew)) / cosh(asinh(Float64(eh / Float64(ew * t)))))); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(eh * N[Sin[N[ArcTan[N[(N[(eh * N[Sin[N[(Pi * 0.5 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.7e+88], t$95$1, If[LessEqual[eh, 270000.0], N[Abs[N[(N[(N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] / N[(t * ew), $MachinePrecision]), $MachinePrecision] * eh + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|eh \cdot \sin \tan^{-1} \left(\frac{eh \cdot \sin \left(\mathsf{fma}\left(\pi, 0.5, t\right)\right)}{ew \cdot \sin t}\right)\right|\\
\mathbf{if}\;eh \leq -2.7 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 270000:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\cos t \cdot eh}{t \cdot ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -2.70000000000000016e88 or 2.7e5 < 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.f6441.5
Applied rewrites41.5%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
+-commutativeN/A
mult-flipN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
lower-PI.f64N/A
metadata-eval41.5
Applied rewrites41.5%
if -2.70000000000000016e88 < eh < 2.7e5Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
Applied rewrites61.8%
Taylor expanded in t around 0
lower-*.f6450.7
Applied rewrites50.7%
Taylor expanded in t around 0
lower-*.f6457.5
Applied rewrites57.5%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6457.5
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6457.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.9
Applied rewrites57.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (tanh (asinh (/ eh (* (tan t) ew)))) eh))))
(if (<= eh -2.7e+88)
t_1
(if (<= eh 270000.0)
(fabs
(/
(fma (/ (* (cos t) eh) (* t ew)) eh (* (sin t) ew))
(cosh (asinh (/ eh (* ew t))))))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((tanh(asinh((eh / (tan(t) * ew)))) * eh));
double tmp;
if (eh <= -2.7e+88) {
tmp = t_1;
} else if (eh <= 270000.0) {
tmp = fabs((fma(((cos(t) * eh) / (t * ew)), eh, (sin(t) * ew)) / cosh(asinh((eh / (ew * t))))));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(Float64(tanh(asinh(Float64(eh / Float64(tan(t) * ew)))) * eh)) tmp = 0.0 if (eh <= -2.7e+88) tmp = t_1; elseif (eh <= 270000.0) tmp = abs(Float64(fma(Float64(Float64(cos(t) * eh) / Float64(t * ew)), eh, Float64(sin(t) * ew)) / cosh(asinh(Float64(eh / Float64(ew * t)))))); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Tanh[N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -2.7e+88], t$95$1, If[LessEqual[eh, 270000.0], N[Abs[N[(N[(N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] / N[(t * ew), $MachinePrecision]), $MachinePrecision] * eh + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right|\\
\mathbf{if}\;eh \leq -2.7 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 270000:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(\frac{\cos t \cdot eh}{t \cdot ew}, eh, \sin t \cdot ew\right)}{\cosh \sinh^{-1} \left(\frac{eh}{ew \cdot t}\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -2.70000000000000016e88 or 2.7e5 < 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.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites41.5%
if -2.70000000000000016e88 < eh < 2.7e5Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
Applied rewrites61.8%
Taylor expanded in t around 0
lower-*.f6450.7
Applied rewrites50.7%
Taylor expanded in t around 0
lower-*.f6457.5
Applied rewrites57.5%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6457.5
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6457.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.9
Applied rewrites57.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (tanh (asinh (/ eh (* (tan t) ew)))) eh)))
(t_2 (/ eh (* t ew))))
(if (<= eh -2.6e+88)
t_1
(if (<= eh 13500.0)
(/
(fabs (fma (/ (* (cos t) eh) (* t ew)) eh (* (sin t) ew)))
(sqrt (fma t_2 t_2 1.0)))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((tanh(asinh((eh / (tan(t) * ew)))) * eh));
double t_2 = eh / (t * ew);
double tmp;
if (eh <= -2.6e+88) {
tmp = t_1;
} else if (eh <= 13500.0) {
tmp = fabs(fma(((cos(t) * eh) / (t * ew)), eh, (sin(t) * ew))) / sqrt(fma(t_2, t_2, 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(eh, ew, t) t_1 = abs(Float64(tanh(asinh(Float64(eh / Float64(tan(t) * ew)))) * eh)) t_2 = Float64(eh / Float64(t * ew)) tmp = 0.0 if (eh <= -2.6e+88) tmp = t_1; elseif (eh <= 13500.0) tmp = Float64(abs(fma(Float64(Float64(cos(t) * eh) / Float64(t * ew)), eh, Float64(sin(t) * ew))) / sqrt(fma(t_2, t_2, 1.0))); else tmp = t_1; end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Tanh[N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eh, -2.6e+88], t$95$1, If[LessEqual[eh, 13500.0], N[(N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] / N[(t * ew), $MachinePrecision]), $MachinePrecision] * eh + N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(t$95$2 * t$95$2 + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right|\\
t_2 := \frac{eh}{t \cdot ew}\\
\mathbf{if}\;eh \leq -2.6 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eh \leq 13500:\\
\;\;\;\;\frac{\left|\mathsf{fma}\left(\frac{\cos t \cdot eh}{t \cdot ew}, eh, \sin t \cdot ew\right)\right|}{\sqrt{\mathsf{fma}\left(t\_2, t\_2, 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eh < -2.6000000000000001e88 or 13500 < 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.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites41.5%
if -2.6000000000000001e88 < eh < 13500Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.8
Applied rewrites61.8%
Taylor expanded in t around 0
lower-*.f6450.7
Applied rewrites50.7%
Taylor expanded in t around 0
lower-*.f6457.5
Applied rewrites57.5%
lift-fabs.f64N/A
lift-/.f64N/A
div-fabsN/A
lift-cosh.f64N/A
lift-asinh.f64N/A
cosh-asinhN/A
sqrt-fabs-revN/A
cosh-asinhN/A
Applied rewrites54.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin t) ew))))
(if (<= ew -2.1e-58)
t_1
(if (<= ew 1.4e+58)
(fabs (* (tanh (asinh (/ eh (* (tan t) ew)))) eh))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * ew));
double tmp;
if (ew <= -2.1e-58) {
tmp = t_1;
} else if (ew <= 1.4e+58) {
tmp = fabs((tanh(asinh((eh / (tan(t) * ew)))) * eh));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(t) * ew)) tmp = 0 if ew <= -2.1e-58: tmp = t_1 elif ew <= 1.4e+58: tmp = math.fabs((math.tanh(math.asinh((eh / (math.tan(t) * ew)))) * eh)) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(t) * ew)) tmp = 0.0 if (ew <= -2.1e-58) tmp = t_1; elseif (ew <= 1.4e+58) tmp = abs(Float64(tanh(asinh(Float64(eh / Float64(tan(t) * ew)))) * 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 <= -2.1e-58) tmp = t_1; elseif (ew <= 1.4e+58) tmp = abs((tanh(asinh((eh / (tan(t) * ew)))) * eh)); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -2.1e-58], t$95$1, If[LessEqual[ew, 1.4e+58], N[Abs[N[(N[Tanh[N[ArcSinh[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $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}\;ew \leq -2.1 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 1.4 \cdot 10^{+58}:\\
\;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -2.09999999999999988e-58 or 1.3999999999999999e58 < ew Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.9
Applied rewrites41.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6441.9
Applied rewrites41.9%
if -2.09999999999999988e-58 < ew < 1.3999999999999999e58Initial 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.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites41.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin t) ew))))
(if (<= ew -2.1e-58)
t_1
(if (<= ew 1.4e+58) (fabs (* eh (sin (atan (/ eh (* ew t)))))) t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * ew));
double tmp;
if (ew <= -2.1e-58) {
tmp = t_1;
} else if (ew <= 1.4e+58) {
tmp = fabs((eh * sin(atan((eh / (ew * t))))));
} else {
tmp = t_1;
}
return tmp;
}
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
real(8) :: tmp
t_1 = abs((sin(t) * ew))
if (ew <= (-2.1d-58)) then
tmp = t_1
else if (ew <= 1.4d+58) then
tmp = abs((eh * sin(atan((eh / (ew * 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((Math.sin(t) * ew));
double tmp;
if (ew <= -2.1e-58) {
tmp = t_1;
} else if (ew <= 1.4e+58) {
tmp = Math.abs((eh * Math.sin(Math.atan((eh / (ew * t))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = math.fabs((math.sin(t) * ew)) tmp = 0 if ew <= -2.1e-58: tmp = t_1 elif ew <= 1.4e+58: tmp = math.fabs((eh * math.sin(math.atan((eh / (ew * t)))))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = abs(Float64(sin(t) * ew)) tmp = 0.0 if (ew <= -2.1e-58) tmp = t_1; elseif (ew <= 1.4e+58) tmp = abs(Float64(eh * sin(atan(Float64(eh / Float64(ew * t)))))); 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 <= -2.1e-58) tmp = t_1; elseif (ew <= 1.4e+58) tmp = abs((eh * sin(atan((eh / (ew * t)))))); 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, -2.1e-58], t$95$1, If[LessEqual[ew, 1.4e+58], N[Abs[N[(eh * N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin t \cdot ew\right|\\
\mathbf{if}\;ew \leq -2.1 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 1.4 \cdot 10^{+58}:\\
\;\;\;\;\left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -2.09999999999999988e-58 or 1.3999999999999999e58 < ew Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.9
Applied rewrites41.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6441.9
Applied rewrites41.9%
if -2.09999999999999988e-58 < ew < 1.3999999999999999e58Initial 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.f6441.5
Applied rewrites41.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (fabs (* (sin t) ew))))
(if (<= ew -2.05e-58)
t_1
(if (<= ew 1.4e+58)
(fabs
(*
(tanh (asinh (/ eh (* (fma (* (* 0.3333333333333333 ew) t) t ew) t))))
eh))
t_1))))
double code(double eh, double ew, double t) {
double t_1 = fabs((sin(t) * ew));
double tmp;
if (ew <= -2.05e-58) {
tmp = t_1;
} else if (ew <= 1.4e+58) {
tmp = fabs((tanh(asinh((eh / (fma(((0.3333333333333333 * ew) * t), t, 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 (ew <= -2.05e-58) tmp = t_1; elseif (ew <= 1.4e+58) tmp = abs(Float64(tanh(asinh(Float64(eh / Float64(fma(Float64(Float64(0.3333333333333333 * ew) * t), t, 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[ew, -2.05e-58], t$95$1, If[LessEqual[ew, 1.4e+58], N[Abs[N[(N[Tanh[N[ArcSinh[N[(eh / N[(N[(N[(N[(0.3333333333333333 * ew), $MachinePrecision] * t), $MachinePrecision] * t + ew), $MachinePrecision] * t), $MachinePrecision]), $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}\;ew \leq -2.05 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ew \leq 1.4 \cdot 10^{+58}:\\
\;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{eh}{\mathsf{fma}\left(\left(0.3333333333333333 \cdot ew\right) \cdot t, t, ew\right) \cdot t}\right) \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if ew < -2.05000000000000014e-58 or 1.3999999999999999e58 < ew Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.9
Applied rewrites41.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6441.9
Applied rewrites41.9%
if -2.05000000000000014e-58 < ew < 1.3999999999999999e58Initial 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.f6441.5
Applied rewrites41.5%
Applied rewrites20.5%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6416.8
Applied rewrites16.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6417.8
Applied rewrites17.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6417.8
Applied rewrites37.7%
(FPCore (eh ew t) :precision binary64 (fabs (* (sin t) ew)))
double code(double eh, double ew, double t) {
return fabs((sin(t) * ew));
}
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((sin(t) * ew))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((Math.sin(t) * ew));
}
def code(eh, ew, t): return math.fabs((math.sin(t) * ew))
function code(eh, ew, t) return abs(Float64(sin(t) * ew)) end
function tmp = code(eh, ew, t) tmp = abs((sin(t) * ew)); end
code[eh_, ew_, t_] := N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\sin t \cdot ew\right|
\end{array}
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.9
Applied rewrites41.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6441.9
Applied rewrites41.9%
(FPCore (eh ew t) :precision binary64 (fabs (* (fma (* (* -0.16666666666666666 ew) t) t ew) t)))
double code(double eh, double ew, double t) {
return fabs((fma(((-0.16666666666666666 * ew) * t), t, ew) * t));
}
function code(eh, ew, t) return abs(Float64(fma(Float64(Float64(-0.16666666666666666 * ew) * t), t, ew) * t)) end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[(-0.16666666666666666 * ew), $MachinePrecision] * t), $MachinePrecision] * t + ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\mathsf{fma}\left(\left(-0.16666666666666666 \cdot ew\right) \cdot t, t, ew\right) \cdot t\right|
\end{array}
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.9
Applied rewrites41.9%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6418.3
Applied rewrites18.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6418.3
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6418.3
Applied rewrites18.3%
(FPCore (eh ew t) :precision binary64 (fabs (* t (fma (* -0.16666666666666666 (* t t)) ew ew))))
double code(double eh, double ew, double t) {
return fabs((t * fma((-0.16666666666666666 * (t * t)), ew, ew)));
}
function code(eh, ew, t) return abs(Float64(t * fma(Float64(-0.16666666666666666 * Float64(t * t)), ew, ew))) end
code[eh_, ew_, t_] := N[Abs[N[(t * N[(N[(-0.16666666666666666 * N[(t * t), $MachinePrecision]), $MachinePrecision] * ew + ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|t \cdot \mathsf{fma}\left(-0.16666666666666666 \cdot \left(t \cdot t\right), ew, ew\right)\right|
\end{array}
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-atan.f64N/A
sin-atanN/A
associate-*r/N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-atan.f64N/A
Applied rewrites62.2%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-sin.f6441.9
Applied rewrites41.9%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6418.3
Applied rewrites18.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6418.3
Applied rewrites18.3%
herbie shell --seed 2025156
(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))))))))