
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
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 * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((-eh * tan(t)) / ew));
return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
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 * tan(t)) / ew))
code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((-eh * math.tan(t)) / ew)) return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((-eh * tan(t)) / ew)); tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
(FPCore (eh ew t) :precision binary64 (fabs (fma (* (sin t) (- eh)) (tanh (asinh (* (/ (tan t) ew) (- eh)))) (/ (* (cos t) ew) (cosh (asinh (/ (* (tan t) eh) ew)))))))
double code(double eh, double ew, double t) {
return fabs(fma((sin(t) * -eh), tanh(asinh(((tan(t) / ew) * -eh))), ((cos(t) * ew) / cosh(asinh(((tan(t) * eh) / ew))))));
}
function code(eh, ew, t) return abs(fma(Float64(sin(t) * Float64(-eh)), tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))), Float64(Float64(cos(t) * ew) / cosh(asinh(Float64(Float64(tan(t) * eh) / ew)))))) end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * (-eh)), $MachinePrecision] * N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\mathsf{fma}\left(\sin t \cdot \left(-eh\right), \tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right), \frac{\cos t \cdot ew}{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)}\right)\right|
Initial program 99.8%
Applied rewrites99.8%
(FPCore (eh ew t) :precision binary64 (fabs (- (/ (* (cos t) ew) (cosh (asinh (/ (* (tan t) eh) ew)))) (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) (* (sin t) eh)))))
double code(double eh, double ew, double t) {
return fabs((((cos(t) * ew) / cosh(asinh(((tan(t) * eh) / ew)))) - (tanh(asinh(((tan(t) / ew) * -eh))) * (sin(t) * eh))));
}
def code(eh, ew, t): return math.fabs((((math.cos(t) * ew) / math.cosh(math.asinh(((math.tan(t) * eh) / ew)))) - (math.tanh(math.asinh(((math.tan(t) / ew) * -eh))) * (math.sin(t) * eh))))
function code(eh, ew, t) return abs(Float64(Float64(Float64(cos(t) * ew) / cosh(asinh(Float64(Float64(tan(t) * eh) / ew)))) - Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * Float64(sin(t) * eh)))) end
function tmp = code(eh, ew, t) tmp = abs((((cos(t) * ew) / cosh(asinh(((tan(t) * eh) / ew)))) - (tanh(asinh(((tan(t) / ew) * -eh))) * (sin(t) * eh)))); end
code[eh_, ew_, t_] := N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] * eh), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\frac{\cos t \cdot ew}{\cosh \sinh^{-1} \left(\frac{\tan t \cdot eh}{ew}\right)} - \tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \left(\sin t \cdot eh\right)\right|
Initial program 99.8%
Applied rewrites99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (atan (/ (* -1.0 (* (fabs eh) t)) ew))))
(if (<= (fabs eh) 4.6e+19)
(fabs
(/
(-
(* (cos t) ew)
(- (* (* (sin t) (fabs eh)) (* (fabs eh) (/ (tan t) ew)))))
(cosh (asinh (/ (* (tan t) (fabs eh)) ew)))))
(fabs
(- (* (* ew (cos t)) (cos t_1)) (* (* (fabs eh) (sin t)) (sin t_1)))))))double code(double eh, double ew, double t) {
double t_1 = atan(((-1.0 * (fabs(eh) * t)) / ew));
double tmp;
if (fabs(eh) <= 4.6e+19) {
tmp = fabs((((cos(t) * ew) - -((sin(t) * fabs(eh)) * (fabs(eh) * (tan(t) / ew)))) / cosh(asinh(((tan(t) * fabs(eh)) / ew)))));
} else {
tmp = fabs((((ew * cos(t)) * cos(t_1)) - ((fabs(eh) * sin(t)) * sin(t_1))));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.atan(((-1.0 * (math.fabs(eh) * t)) / ew)) tmp = 0 if math.fabs(eh) <= 4.6e+19: tmp = math.fabs((((math.cos(t) * ew) - -((math.sin(t) * math.fabs(eh)) * (math.fabs(eh) * (math.tan(t) / ew)))) / math.cosh(math.asinh(((math.tan(t) * math.fabs(eh)) / ew))))) else: tmp = math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((math.fabs(eh) * math.sin(t)) * math.sin(t_1)))) return tmp
function code(eh, ew, t) t_1 = atan(Float64(Float64(-1.0 * Float64(abs(eh) * t)) / ew)) tmp = 0.0 if (abs(eh) <= 4.6e+19) tmp = abs(Float64(Float64(Float64(cos(t) * ew) - Float64(-Float64(Float64(sin(t) * abs(eh)) * Float64(abs(eh) * Float64(tan(t) / ew))))) / cosh(asinh(Float64(Float64(tan(t) * abs(eh)) / ew))))); else tmp = abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(abs(eh) * sin(t)) * sin(t_1)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = atan(((-1.0 * (abs(eh) * t)) / ew)); tmp = 0.0; if (abs(eh) <= 4.6e+19) tmp = abs((((cos(t) * ew) - -((sin(t) * abs(eh)) * (abs(eh) * (tan(t) / ew)))) / cosh(asinh(((tan(t) * abs(eh)) / ew))))); else tmp = abs((((ew * cos(t)) * cos(t_1)) - ((abs(eh) * sin(t)) * sin(t_1)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(-1.0 * N[(N[Abs[eh], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[eh], $MachinePrecision], 4.6e+19], N[Abs[N[(N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] - (-N[(N[(N[Sin[t], $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[eh], $MachinePrecision] * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / N[Cosh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Abs[eh], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{-1 \cdot \left(\left|eh\right| \cdot t\right)}{ew}\right)\\
\mathbf{if}\;\left|eh\right| \leq 4.6 \cdot 10^{+19}:\\
\;\;\;\;\left|\frac{\cos t \cdot ew - \left(-\left(\sin t \cdot \left|eh\right|\right) \cdot \left(\left|eh\right| \cdot \frac{\tan t}{ew}\right)\right)}{\cosh \sinh^{-1} \left(\frac{\tan t \cdot \left|eh\right|}{ew}\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(\left|eh\right| \cdot \sin t\right) \cdot \sin t\_1\right|\\
\end{array}
if eh < 4.6e19Initial program 99.8%
Applied rewrites82.2%
if 4.6e19 < eh Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6489.8%
Applied rewrites89.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6489.8%
Applied rewrites89.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (/ (tan t) ew) (fabs eh)))
(t_2 (atan (/ (* -1.0 (* (fabs eh) t)) ew))))
(if (<= (fabs eh) 3e-42)
(/ (fabs (* (- (pow t_1 2.0) -1.0) (* (cos t) ew))) (cosh (asinh t_1)))
(fabs
(- (* (* ew (cos t)) (cos t_2)) (* (* (fabs eh) (sin t)) (sin t_2)))))))double code(double eh, double ew, double t) {
double t_1 = (tan(t) / ew) * fabs(eh);
double t_2 = atan(((-1.0 * (fabs(eh) * t)) / ew));
double tmp;
if (fabs(eh) <= 3e-42) {
tmp = fabs(((pow(t_1, 2.0) - -1.0) * (cos(t) * ew))) / cosh(asinh(t_1));
} else {
tmp = fabs((((ew * cos(t)) * cos(t_2)) - ((fabs(eh) * sin(t)) * sin(t_2))));
}
return tmp;
}
def code(eh, ew, t): t_1 = (math.tan(t) / ew) * math.fabs(eh) t_2 = math.atan(((-1.0 * (math.fabs(eh) * t)) / ew)) tmp = 0 if math.fabs(eh) <= 3e-42: tmp = math.fabs(((math.pow(t_1, 2.0) - -1.0) * (math.cos(t) * ew))) / math.cosh(math.asinh(t_1)) else: tmp = math.fabs((((ew * math.cos(t)) * math.cos(t_2)) - ((math.fabs(eh) * math.sin(t)) * math.sin(t_2)))) return tmp
function code(eh, ew, t) t_1 = Float64(Float64(tan(t) / ew) * abs(eh)) t_2 = atan(Float64(Float64(-1.0 * Float64(abs(eh) * t)) / ew)) tmp = 0.0 if (abs(eh) <= 3e-42) tmp = Float64(abs(Float64(Float64((t_1 ^ 2.0) - -1.0) * Float64(cos(t) * ew))) / cosh(asinh(t_1))); else tmp = abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_2)) - Float64(Float64(abs(eh) * sin(t)) * sin(t_2)))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = (tan(t) / ew) * abs(eh); t_2 = atan(((-1.0 * (abs(eh) * t)) / ew)); tmp = 0.0; if (abs(eh) <= 3e-42) tmp = abs((((t_1 ^ 2.0) - -1.0) * (cos(t) * ew))) / cosh(asinh(t_1)); else tmp = abs((((ew * cos(t)) * cos(t_2)) - ((abs(eh) * sin(t)) * sin(t_2)))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[(-1.0 * N[(N[Abs[eh], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[eh], $MachinePrecision], 3e-42], N[(N[Abs[N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] - -1.0), $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Abs[eh], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{\tan t}{ew} \cdot \left|eh\right|\\
t_2 := \tan^{-1} \left(\frac{-1 \cdot \left(\left|eh\right| \cdot t\right)}{ew}\right)\\
\mathbf{if}\;\left|eh\right| \leq 3 \cdot 10^{-42}:\\
\;\;\;\;\frac{\left|\left({t\_1}^{2} - -1\right) \cdot \left(\cos t \cdot ew\right)\right|}{\cosh \sinh^{-1} t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left|\left(ew \cdot \cos t\right) \cdot \cos t\_2 - \left(\left|eh\right| \cdot \sin t\right) \cdot \sin t\_2\right|\\
\end{array}
if eh < 3.00000000000000027e-42Initial program 99.8%
Applied rewrites99.8%
Applied rewrites76.8%
if 3.00000000000000027e-42 < eh Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6489.8%
Applied rewrites89.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-*.f6489.8%
Applied rewrites89.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (/ (tan (fabs t)) ew) eh))
(t_2 (* (cos (fabs t)) ew))
(t_3 (asinh (* (/ (fabs t) ew) eh))))
(if (<= (fabs t) 1960000.0)
(fabs
(-
(/ t_2 (cosh t_3))
(*
(tanh (- t_3))
(*
(fma (* (* (fabs t) (fabs t)) eh) -0.16666666666666666 eh)
(fabs t)))))
(/ (fabs (* (- (pow t_1 2.0) -1.0) t_2)) (cosh (asinh t_1))))))double code(double eh, double ew, double t) {
double t_1 = (tan(fabs(t)) / ew) * eh;
double t_2 = cos(fabs(t)) * ew;
double t_3 = asinh(((fabs(t) / ew) * eh));
double tmp;
if (fabs(t) <= 1960000.0) {
tmp = fabs(((t_2 / cosh(t_3)) - (tanh(-t_3) * (fma(((fabs(t) * fabs(t)) * eh), -0.16666666666666666, eh) * fabs(t)))));
} else {
tmp = fabs(((pow(t_1, 2.0) - -1.0) * t_2)) / cosh(asinh(t_1));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(Float64(tan(abs(t)) / ew) * eh) t_2 = Float64(cos(abs(t)) * ew) t_3 = asinh(Float64(Float64(abs(t) / ew) * eh)) tmp = 0.0 if (abs(t) <= 1960000.0) tmp = abs(Float64(Float64(t_2 / cosh(t_3)) - Float64(tanh(Float64(-t_3)) * Float64(fma(Float64(Float64(abs(t) * abs(t)) * eh), -0.16666666666666666, eh) * abs(t))))); else tmp = Float64(abs(Float64(Float64((t_1 ^ 2.0) - -1.0) * t_2)) / cosh(asinh(t_1))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[Tan[N[Abs[t], $MachinePrecision]], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[N[Abs[t], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[ArcSinh[N[(N[(N[Abs[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 1960000.0], N[Abs[N[(N[(t$95$2 / N[Cosh[t$95$3], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[(-t$95$3)], $MachinePrecision] * N[(N[(N[(N[(N[Abs[t], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * -0.16666666666666666 + eh), $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Abs[N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] - -1.0), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{\tan \left(\left|t\right|\right)}{ew} \cdot eh\\
t_2 := \cos \left(\left|t\right|\right) \cdot ew\\
t_3 := \sinh^{-1} \left(\frac{\left|t\right|}{ew} \cdot eh\right)\\
\mathbf{if}\;\left|t\right| \leq 1960000:\\
\;\;\;\;\left|\frac{t\_2}{\cosh t\_3} - \tanh \left(-t\_3\right) \cdot \left(\mathsf{fma}\left(\left(\left|t\right| \cdot \left|t\right|\right) \cdot eh, -0.16666666666666666, eh\right) \cdot \left|t\right|\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|\left({t\_1}^{2} - -1\right) \cdot t\_2\right|}{\cosh \sinh^{-1} t\_1}\\
\end{array}
if t < 1.96e6Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6460.2%
Applied rewrites60.2%
Applied rewrites60.2%
Taylor expanded in t around 0
lower-/.f6460.2%
Applied rewrites60.2%
Taylor expanded in t around 0
lower-/.f6459.8%
Applied rewrites59.8%
if 1.96e6 < t Initial program 99.8%
Applied rewrites99.8%
Applied rewrites76.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sin (fabs t)))
(t_2 (* (cos (fabs t)) ew))
(t_3 (asinh (* (/ (fabs t) ew) eh)))
(t_4 (tanh (- t_3))))
(if (<= (fabs t) 1.15e+55)
(fabs
(-
(/ t_2 (cosh t_3))
(*
t_4
(*
(fma (* (* (fabs t) (fabs t)) eh) -0.16666666666666666 eh)
(fabs t)))))
(if (<= (fabs t) 2.35e+269)
(fabs (* (* t_4 t_1) (- eh)))
(fabs
(/ (- t_2 (- (* (* t_1 eh) (* eh (/ (tan (fabs t)) ew))))) 1.0))))))double code(double eh, double ew, double t) {
double t_1 = sin(fabs(t));
double t_2 = cos(fabs(t)) * ew;
double t_3 = asinh(((fabs(t) / ew) * eh));
double t_4 = tanh(-t_3);
double tmp;
if (fabs(t) <= 1.15e+55) {
tmp = fabs(((t_2 / cosh(t_3)) - (t_4 * (fma(((fabs(t) * fabs(t)) * eh), -0.16666666666666666, eh) * fabs(t)))));
} else if (fabs(t) <= 2.35e+269) {
tmp = fabs(((t_4 * t_1) * -eh));
} else {
tmp = fabs(((t_2 - -((t_1 * eh) * (eh * (tan(fabs(t)) / ew)))) / 1.0));
}
return tmp;
}
function code(eh, ew, t) t_1 = sin(abs(t)) t_2 = Float64(cos(abs(t)) * ew) t_3 = asinh(Float64(Float64(abs(t) / ew) * eh)) t_4 = tanh(Float64(-t_3)) tmp = 0.0 if (abs(t) <= 1.15e+55) tmp = abs(Float64(Float64(t_2 / cosh(t_3)) - Float64(t_4 * Float64(fma(Float64(Float64(abs(t) * abs(t)) * eh), -0.16666666666666666, eh) * abs(t))))); elseif (abs(t) <= 2.35e+269) tmp = abs(Float64(Float64(t_4 * t_1) * Float64(-eh))); else tmp = abs(Float64(Float64(t_2 - Float64(-Float64(Float64(t_1 * eh) * Float64(eh * Float64(tan(abs(t)) / ew))))) / 1.0)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[N[Abs[t], $MachinePrecision]], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$3 = N[ArcSinh[N[(N[(N[Abs[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Tanh[(-t$95$3)], $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 1.15e+55], N[Abs[N[(N[(t$95$2 / N[Cosh[t$95$3], $MachinePrecision]), $MachinePrecision] - N[(t$95$4 * N[(N[(N[(N[(N[Abs[t], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * -0.16666666666666666 + eh), $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 2.35e+269], N[Abs[N[(N[(t$95$4 * t$95$1), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(t$95$2 - (-N[(N[(t$95$1 * eh), $MachinePrecision] * N[(eh * N[(N[Tan[N[Abs[t], $MachinePrecision]], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / 1.0), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \sin \left(\left|t\right|\right)\\
t_2 := \cos \left(\left|t\right|\right) \cdot ew\\
t_3 := \sinh^{-1} \left(\frac{\left|t\right|}{ew} \cdot eh\right)\\
t_4 := \tanh \left(-t\_3\right)\\
\mathbf{if}\;\left|t\right| \leq 1.15 \cdot 10^{+55}:\\
\;\;\;\;\left|\frac{t\_2}{\cosh t\_3} - t\_4 \cdot \left(\mathsf{fma}\left(\left(\left|t\right| \cdot \left|t\right|\right) \cdot eh, -0.16666666666666666, eh\right) \cdot \left|t\right|\right)\right|\\
\mathbf{elif}\;\left|t\right| \leq 2.35 \cdot 10^{+269}:\\
\;\;\;\;\left|\left(t\_4 \cdot t\_1\right) \cdot \left(-eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{t\_2 - \left(-\left(t\_1 \cdot eh\right) \cdot \left(eh \cdot \frac{\tan \left(\left|t\right|\right)}{ew}\right)\right)}{1}\right|\\
\end{array}
if t < 1.14999999999999994e55Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6460.2%
Applied rewrites60.2%
Applied rewrites60.2%
Taylor expanded in t around 0
lower-/.f6460.2%
Applied rewrites60.2%
Taylor expanded in t around 0
lower-/.f6459.8%
Applied rewrites59.8%
if 1.14999999999999994e55 < t < 2.35e269Initial program 99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
Applied rewrites41.4%
Applied rewrites41.3%
Taylor expanded in t around 0
lower-/.f6441.5%
Applied rewrites41.5%
if 2.35e269 < t Initial program 99.8%
Applied rewrites82.2%
Taylor expanded in eh around 0
Applied rewrites62.4%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (cos (fabs t)))
(t_2 (asinh (* (/ (fabs t) ew) eh)))
(t_3 (tanh (- t_2))))
(if (<= (fabs t) 1.15e+55)
(fabs
(-
(/ (* t_1 ew) (cosh t_2))
(*
t_3
(*
(fma (* (* (fabs t) (fabs t)) eh) -0.16666666666666666 eh)
(fabs t)))))
(if (<= (fabs t) 2.35e+269)
(fabs (* (* t_3 (sin (fabs t))) (- eh)))
(fabs (* ew t_1))))))double code(double eh, double ew, double t) {
double t_1 = cos(fabs(t));
double t_2 = asinh(((fabs(t) / ew) * eh));
double t_3 = tanh(-t_2);
double tmp;
if (fabs(t) <= 1.15e+55) {
tmp = fabs((((t_1 * ew) / cosh(t_2)) - (t_3 * (fma(((fabs(t) * fabs(t)) * eh), -0.16666666666666666, eh) * fabs(t)))));
} else if (fabs(t) <= 2.35e+269) {
tmp = fabs(((t_3 * sin(fabs(t))) * -eh));
} else {
tmp = fabs((ew * t_1));
}
return tmp;
}
function code(eh, ew, t) t_1 = cos(abs(t)) t_2 = asinh(Float64(Float64(abs(t) / ew) * eh)) t_3 = tanh(Float64(-t_2)) tmp = 0.0 if (abs(t) <= 1.15e+55) tmp = abs(Float64(Float64(Float64(t_1 * ew) / cosh(t_2)) - Float64(t_3 * Float64(fma(Float64(Float64(abs(t) * abs(t)) * eh), -0.16666666666666666, eh) * abs(t))))); elseif (abs(t) <= 2.35e+269) tmp = abs(Float64(Float64(t_3 * sin(abs(t))) * Float64(-eh))); else tmp = abs(Float64(ew * t_1)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Cos[N[Abs[t], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[ArcSinh[N[(N[(N[Abs[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Tanh[(-t$95$2)], $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 1.15e+55], N[Abs[N[(N[(N[(t$95$1 * ew), $MachinePrecision] / N[Cosh[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(t$95$3 * N[(N[(N[(N[(N[Abs[t], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * -0.16666666666666666 + eh), $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 2.35e+269], N[Abs[N[(N[(t$95$3 * N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * t$95$1), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \cos \left(\left|t\right|\right)\\
t_2 := \sinh^{-1} \left(\frac{\left|t\right|}{ew} \cdot eh\right)\\
t_3 := \tanh \left(-t\_2\right)\\
\mathbf{if}\;\left|t\right| \leq 1.15 \cdot 10^{+55}:\\
\;\;\;\;\left|\frac{t\_1 \cdot ew}{\cosh t\_2} - t\_3 \cdot \left(\mathsf{fma}\left(\left(\left|t\right| \cdot \left|t\right|\right) \cdot eh, -0.16666666666666666, eh\right) \cdot \left|t\right|\right)\right|\\
\mathbf{elif}\;\left|t\right| \leq 2.35 \cdot 10^{+269}:\\
\;\;\;\;\left|\left(t\_3 \cdot \sin \left(\left|t\right|\right)\right) \cdot \left(-eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot t\_1\right|\\
\end{array}
if t < 1.14999999999999994e55Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6460.2%
Applied rewrites60.2%
Applied rewrites60.2%
Taylor expanded in t around 0
lower-/.f6460.2%
Applied rewrites60.2%
Taylor expanded in t around 0
lower-/.f6459.8%
Applied rewrites59.8%
if 1.14999999999999994e55 < t < 2.35e269Initial program 99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
Applied rewrites41.4%
Applied rewrites41.3%
Taylor expanded in t around 0
lower-/.f6441.5%
Applied rewrites41.5%
if 2.35e269 < t Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.9%
Applied rewrites61.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (cos (fabs t))) (t_2 (/ (* eh (fabs t)) ew)))
(if (<= (fabs t) 1.15e+55)
(fabs
(-
(/ (* t_1 ew) (cosh t_2))
(*
(tanh (- t_2))
(*
(fma (* (* (fabs t) (fabs t)) eh) -0.16666666666666666 eh)
(fabs t)))))
(if (<= (fabs t) 2.35e+269)
(fabs
(*
(* (tanh (- (asinh (* (/ (fabs t) ew) eh)))) (sin (fabs t)))
(- eh)))
(fabs (* ew t_1))))))double code(double eh, double ew, double t) {
double t_1 = cos(fabs(t));
double t_2 = (eh * fabs(t)) / ew;
double tmp;
if (fabs(t) <= 1.15e+55) {
tmp = fabs((((t_1 * ew) / cosh(t_2)) - (tanh(-t_2) * (fma(((fabs(t) * fabs(t)) * eh), -0.16666666666666666, eh) * fabs(t)))));
} else if (fabs(t) <= 2.35e+269) {
tmp = fabs(((tanh(-asinh(((fabs(t) / ew) * eh))) * sin(fabs(t))) * -eh));
} else {
tmp = fabs((ew * t_1));
}
return tmp;
}
function code(eh, ew, t) t_1 = cos(abs(t)) t_2 = Float64(Float64(eh * abs(t)) / ew) tmp = 0.0 if (abs(t) <= 1.15e+55) tmp = abs(Float64(Float64(Float64(t_1 * ew) / cosh(t_2)) - Float64(tanh(Float64(-t_2)) * Float64(fma(Float64(Float64(abs(t) * abs(t)) * eh), -0.16666666666666666, eh) * abs(t))))); elseif (abs(t) <= 2.35e+269) tmp = abs(Float64(Float64(tanh(Float64(-asinh(Float64(Float64(abs(t) / ew) * eh)))) * sin(abs(t))) * Float64(-eh))); else tmp = abs(Float64(ew * t_1)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Cos[N[Abs[t], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(eh * N[Abs[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 1.15e+55], N[Abs[N[(N[(N[(t$95$1 * ew), $MachinePrecision] / N[Cosh[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[(-t$95$2)], $MachinePrecision] * N[(N[(N[(N[(N[Abs[t], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] * -0.16666666666666666 + eh), $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 2.35e+269], N[Abs[N[(N[(N[Tanh[(-N[ArcSinh[N[(N[(N[Abs[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision])], $MachinePrecision] * N[Sin[N[Abs[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * t$95$1), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \cos \left(\left|t\right|\right)\\
t_2 := \frac{eh \cdot \left|t\right|}{ew}\\
\mathbf{if}\;\left|t\right| \leq 1.15 \cdot 10^{+55}:\\
\;\;\;\;\left|\frac{t\_1 \cdot ew}{\cosh t\_2} - \tanh \left(-t\_2\right) \cdot \left(\mathsf{fma}\left(\left(\left|t\right| \cdot \left|t\right|\right) \cdot eh, -0.16666666666666666, eh\right) \cdot \left|t\right|\right)\right|\\
\mathbf{elif}\;\left|t\right| \leq 2.35 \cdot 10^{+269}:\\
\;\;\;\;\left|\left(\tanh \left(-\sinh^{-1} \left(\frac{\left|t\right|}{ew} \cdot eh\right)\right) \cdot \sin \left(\left|t\right|\right)\right) \cdot \left(-eh\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot t\_1\right|\\
\end{array}
if t < 1.14999999999999994e55Initial program 99.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6460.2%
Applied rewrites60.2%
Applied rewrites60.2%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6460.0%
Applied rewrites60.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6459.6%
Applied rewrites59.6%
if 1.14999999999999994e55 < t < 2.35e269Initial program 99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
Applied rewrites41.4%
Applied rewrites41.3%
Taylor expanded in t around 0
lower-/.f6441.5%
Applied rewrites41.5%
if 2.35e269 < t Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.9%
Applied rewrites61.9%
(FPCore (eh ew t)
:precision binary64
(if (<= (fabs eh) 1.05e+36)
(fabs (* ew (cos t)))
(fabs
(* (* (tanh (- (asinh (* (/ t ew) (fabs eh))))) (sin t)) (- (fabs eh))))))double code(double eh, double ew, double t) {
double tmp;
if (fabs(eh) <= 1.05e+36) {
tmp = fabs((ew * cos(t)));
} else {
tmp = fabs(((tanh(-asinh(((t / ew) * fabs(eh)))) * sin(t)) * -fabs(eh)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if math.fabs(eh) <= 1.05e+36: tmp = math.fabs((ew * math.cos(t))) else: tmp = math.fabs(((math.tanh(-math.asinh(((t / ew) * math.fabs(eh)))) * math.sin(t)) * -math.fabs(eh))) return tmp
function code(eh, ew, t) tmp = 0.0 if (abs(eh) <= 1.05e+36) tmp = abs(Float64(ew * cos(t))); else tmp = abs(Float64(Float64(tanh(Float64(-asinh(Float64(Float64(t / ew) * abs(eh))))) * sin(t)) * Float64(-abs(eh)))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (abs(eh) <= 1.05e+36) tmp = abs((ew * cos(t))); else tmp = abs(((tanh(-asinh(((t / ew) * abs(eh)))) * sin(t)) * -abs(eh))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[N[Abs[eh], $MachinePrecision], 1.05e+36], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Tanh[(-N[ArcSinh[N[(N[(t / ew), $MachinePrecision] * N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision] * (-N[Abs[eh], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|eh\right| \leq 1.05 \cdot 10^{+36}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\tanh \left(-\sinh^{-1} \left(\frac{t}{ew} \cdot \left|eh\right|\right)\right) \cdot \sin t\right) \cdot \left(-\left|eh\right|\right)\right|\\
\end{array}
if eh < 1.05000000000000002e36Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.9%
Applied rewrites61.9%
if 1.05000000000000002e36 < eh Initial program 99.8%
Taylor expanded in eh around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
lower-atan.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
Applied rewrites41.4%
Applied rewrites41.3%
Taylor expanded in t around 0
lower-/.f6441.5%
Applied rewrites41.5%
(FPCore (eh ew t) :precision binary64 (fabs (* ew (cos t))))
double code(double eh, double ew, double t) {
return fabs((ew * cos(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 * cos(t)))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * Math.cos(t)));
}
def code(eh, ew, t): return math.fabs((ew * math.cos(t)))
function code(eh, ew, t) return abs(Float64(ew * cos(t))) end
function tmp = code(eh, ew, t) tmp = abs((ew * cos(t))); end
code[eh_, ew_, t_] := N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|ew \cdot \cos t\right|
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.9%
Applied rewrites61.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (sqrt (fabs ew))) (t_2 (atan (/ (* (- eh) (tan t)) (fabs ew)))))
(if (<=
(- (* (* (fabs ew) (cos t)) (cos t_2)) (* (* eh (sin t)) (sin t_2)))
-2e-239)
(* t_1 t_1)
(* (cos t) (fabs ew)))))double code(double eh, double ew, double t) {
double t_1 = sqrt(fabs(ew));
double t_2 = atan(((-eh * tan(t)) / fabs(ew)));
double tmp;
if ((((fabs(ew) * cos(t)) * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= -2e-239) {
tmp = t_1 * t_1;
} else {
tmp = cos(t) * fabs(ew);
}
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) :: t_2
real(8) :: tmp
t_1 = sqrt(abs(ew))
t_2 = atan(((-eh * tan(t)) / abs(ew)))
if ((((abs(ew) * cos(t)) * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= (-2d-239)) then
tmp = t_1 * t_1
else
tmp = cos(t) * abs(ew)
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sqrt(Math.abs(ew));
double t_2 = Math.atan(((-eh * Math.tan(t)) / Math.abs(ew)));
double tmp;
if ((((Math.abs(ew) * Math.cos(t)) * Math.cos(t_2)) - ((eh * Math.sin(t)) * Math.sin(t_2))) <= -2e-239) {
tmp = t_1 * t_1;
} else {
tmp = Math.cos(t) * Math.abs(ew);
}
return tmp;
}
def code(eh, ew, t): t_1 = math.sqrt(math.fabs(ew)) t_2 = math.atan(((-eh * math.tan(t)) / math.fabs(ew))) tmp = 0 if (((math.fabs(ew) * math.cos(t)) * math.cos(t_2)) - ((eh * math.sin(t)) * math.sin(t_2))) <= -2e-239: tmp = t_1 * t_1 else: tmp = math.cos(t) * math.fabs(ew) return tmp
function code(eh, ew, t) t_1 = sqrt(abs(ew)) t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / abs(ew))) tmp = 0.0 if (Float64(Float64(Float64(abs(ew) * cos(t)) * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2))) <= -2e-239) tmp = Float64(t_1 * t_1); else tmp = Float64(cos(t) * abs(ew)); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = sqrt(abs(ew)); t_2 = atan(((-eh * tan(t)) / abs(ew))); tmp = 0.0; if ((((abs(ew) * cos(t)) * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= -2e-239) tmp = t_1 * t_1; else tmp = cos(t) * abs(ew); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sqrt[N[Abs[ew], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / N[Abs[ew], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[Abs[ew], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-239], N[(t$95$1 * t$95$1), $MachinePrecision], N[(N[Cos[t], $MachinePrecision] * N[Abs[ew], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \sqrt{\left|ew\right|}\\
t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{\left|ew\right|}\right)\\
\mathbf{if}\;\left(\left|ew\right| \cdot \cos t\right) \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq -2 \cdot 10^{-239}:\\
\;\;\;\;t\_1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\cos t \cdot \left|ew\right|\\
\end{array}
if (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) < -2.0000000000000002e-239Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.9%
Applied rewrites61.9%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-unsound-*.f64N/A
Applied rewrites30.7%
Taylor expanded in t around 0
lower-sqrt.f6419.6%
Applied rewrites19.6%
Taylor expanded in t around 0
lower-sqrt.f6421.0%
Applied rewrites21.0%
if -2.0000000000000002e-239 < (-.f64 (*.f64 (*.f64 ew (cos.f64 t)) (cos.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew)))) (*.f64 (*.f64 eh (sin.f64 t)) (sin.f64 (atan.f64 (/.f64 (*.f64 (neg.f64 eh) (tan.f64 t)) ew))))) Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.9%
Applied rewrites61.9%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-unsound-*.f64N/A
Applied rewrites30.7%
Applied rewrites31.7%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (sqrt (fabs ew)))) (* t_1 t_1)))
double code(double eh, double ew, double t) {
double t_1 = sqrt(fabs(ew));
return t_1 * 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 = sqrt(abs(ew))
code = t_1 * t_1
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.sqrt(Math.abs(ew));
return t_1 * t_1;
}
def code(eh, ew, t): t_1 = math.sqrt(math.fabs(ew)) return t_1 * t_1
function code(eh, ew, t) t_1 = sqrt(abs(ew)) return Float64(t_1 * t_1) end
function tmp = code(eh, ew, t) t_1 = sqrt(abs(ew)); tmp = t_1 * t_1; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Sqrt[N[Abs[ew], $MachinePrecision]], $MachinePrecision]}, N[(t$95$1 * t$95$1), $MachinePrecision]]
\begin{array}{l}
t_1 := \sqrt{\left|ew\right|}\\
t\_1 \cdot t\_1
\end{array}
Initial program 99.8%
Applied rewrites99.8%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6461.9%
Applied rewrites61.9%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-unsound-*.f64N/A
Applied rewrites30.7%
Taylor expanded in t around 0
lower-sqrt.f6419.6%
Applied rewrites19.6%
Taylor expanded in t around 0
lower-sqrt.f6421.0%
Applied rewrites21.0%
herbie shell --seed 2025189
(FPCore (eh ew t)
:name "Example 2 from Robby"
:precision binary64
(fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))