
(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}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Herbie found 15 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}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew)))) (fabs (- (* (* 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}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (asinh (* (/ (tan t) ew) eh))))
(fabs
(fma (* (cos t) ew) (/ 1.0 (cosh t_1)) (* (* (tanh t_1) eh) (sin t))))))
double code(double eh, double ew, double t) {
double t_1 = asinh(((tan(t) / ew) * eh));
return fabs(fma((cos(t) * ew), (1.0 / cosh(t_1)), ((tanh(t_1) * eh) * sin(t))));
}
function code(eh, ew, t) t_1 = asinh(Float64(Float64(tan(t) / ew) * eh)) return abs(fma(Float64(cos(t) * ew), Float64(1.0 / cosh(t_1)), Float64(Float64(tanh(t_1) * eh) * sin(t)))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] * N[(1.0 / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Tanh[t$95$1], $MachinePrecision] * eh), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{\tan t}{ew} \cdot eh\right)\\
\left|\mathsf{fma}\left(\cos t \cdot ew, \frac{1}{\cosh t\_1}, \left(\tanh t\_1 \cdot eh\right) \cdot \sin t\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Applied rewrites99.7%
Applied rewrites99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t)))
(t_2 (atan (/ (* (- eh) (tan t)) ew)))
(t_3 (* (cos t) ew))
(t_4 (* eh (sin t)))
(t_5 (- (* t_1 (cos t_2)) (* t_4 (sin t_2))))
(t_6 (atan (/ (* -1.0 (* eh t)) ew)))
(t_7 (/ (tan t) ew))
(t_8 (* t_7 eh))
(t_9 (asinh (* t_7 (- eh)))))
(if (<= t_5 -1e+164)
(fabs (- (* t_1 (cos t_6)) (* t_4 (sin t_6))))
(if (<= t_5 -1e-279)
(/ (fabs (* (- (pow t_8 2.0) -1.0) t_3)) (cosh (asinh t_8)))
(- (/ t_3 (cosh t_9)) (* (tanh t_9) (* (sin t) eh)))))))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double t_2 = atan(((-eh * tan(t)) / ew));
double t_3 = cos(t) * ew;
double t_4 = eh * sin(t);
double t_5 = (t_1 * cos(t_2)) - (t_4 * sin(t_2));
double t_6 = atan(((-1.0 * (eh * t)) / ew));
double t_7 = tan(t) / ew;
double t_8 = t_7 * eh;
double t_9 = asinh((t_7 * -eh));
double tmp;
if (t_5 <= -1e+164) {
tmp = fabs(((t_1 * cos(t_6)) - (t_4 * sin(t_6))));
} else if (t_5 <= -1e-279) {
tmp = fabs(((pow(t_8, 2.0) - -1.0) * t_3)) / cosh(asinh(t_8));
} else {
tmp = (t_3 / cosh(t_9)) - (tanh(t_9) * (sin(t) * eh));
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) t_2 = math.atan(((-eh * math.tan(t)) / ew)) t_3 = math.cos(t) * ew t_4 = eh * math.sin(t) t_5 = (t_1 * math.cos(t_2)) - (t_4 * math.sin(t_2)) t_6 = math.atan(((-1.0 * (eh * t)) / ew)) t_7 = math.tan(t) / ew t_8 = t_7 * eh t_9 = math.asinh((t_7 * -eh)) tmp = 0 if t_5 <= -1e+164: tmp = math.fabs(((t_1 * math.cos(t_6)) - (t_4 * math.sin(t_6)))) elif t_5 <= -1e-279: tmp = math.fabs(((math.pow(t_8, 2.0) - -1.0) * t_3)) / math.cosh(math.asinh(t_8)) else: tmp = (t_3 / math.cosh(t_9)) - (math.tanh(t_9) * (math.sin(t) * eh)) return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) t_3 = Float64(cos(t) * ew) t_4 = Float64(eh * sin(t)) t_5 = Float64(Float64(t_1 * cos(t_2)) - Float64(t_4 * sin(t_2))) t_6 = atan(Float64(Float64(-1.0 * Float64(eh * t)) / ew)) t_7 = Float64(tan(t) / ew) t_8 = Float64(t_7 * eh) t_9 = asinh(Float64(t_7 * Float64(-eh))) tmp = 0.0 if (t_5 <= -1e+164) tmp = abs(Float64(Float64(t_1 * cos(t_6)) - Float64(t_4 * sin(t_6)))); elseif (t_5 <= -1e-279) tmp = Float64(abs(Float64(Float64((t_8 ^ 2.0) - -1.0) * t_3)) / cosh(asinh(t_8))); else tmp = Float64(Float64(t_3 / cosh(t_9)) - Float64(tanh(t_9) * Float64(sin(t) * eh))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); t_2 = atan(((-eh * tan(t)) / ew)); t_3 = cos(t) * ew; t_4 = eh * sin(t); t_5 = (t_1 * cos(t_2)) - (t_4 * sin(t_2)); t_6 = atan(((-1.0 * (eh * t)) / ew)); t_7 = tan(t) / ew; t_8 = t_7 * eh; t_9 = asinh((t_7 * -eh)); tmp = 0.0; if (t_5 <= -1e+164) tmp = abs(((t_1 * cos(t_6)) - (t_4 * sin(t_6)))); elseif (t_5 <= -1e-279) tmp = abs((((t_8 ^ 2.0) - -1.0) * t_3)) / cosh(asinh(t_8)); else tmp = (t_3 / cosh(t_9)) - (tanh(t_9) * (sin(t) * eh)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision]}, Block[{t$95$4 = N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(t$95$4 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[ArcTan[N[(N[(-1.0 * N[(eh * t), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$7 * eh), $MachinePrecision]}, Block[{t$95$9 = N[ArcSinh[N[(t$95$7 * (-eh)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$5, -1e+164], N[Abs[N[(N[(t$95$1 * N[Cos[t$95$6], $MachinePrecision]), $MachinePrecision] - N[(t$95$4 * N[Sin[t$95$6], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, -1e-279], N[(N[Abs[N[(N[(N[Power[t$95$8, 2.0], $MachinePrecision] - -1.0), $MachinePrecision] * t$95$3), $MachinePrecision]], $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$8], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 / N[Cosh[t$95$9], $MachinePrecision]), $MachinePrecision] - N[(N[Tanh[t$95$9], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
t_3 := \cos t \cdot ew\\
t_4 := eh \cdot \sin t\\
t_5 := t\_1 \cdot \cos t\_2 - t\_4 \cdot \sin t\_2\\
t_6 := \tan^{-1} \left(\frac{-1 \cdot \left(eh \cdot t\right)}{ew}\right)\\
t_7 := \frac{\tan t}{ew}\\
t_8 := t\_7 \cdot eh\\
t_9 := \sinh^{-1} \left(t\_7 \cdot \left(-eh\right)\right)\\
\mathbf{if}\;t\_5 \leq -1 \cdot 10^{+164}:\\
\;\;\;\;\left|t\_1 \cdot \cos t\_6 - t\_4 \cdot \sin t\_6\right|\\
\mathbf{elif}\;t\_5 \leq -1 \cdot 10^{-279}:\\
\;\;\;\;\frac{\left|\left({t\_8}^{2} - -1\right) \cdot t\_3\right|}{\cosh \sinh^{-1} t\_8}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_3}{\cosh t\_9} - \tanh t\_9 \cdot \left(\sin t \cdot eh\right)\\
\end{array}
\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))))) < -1e164Initial 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%
if -1e164 < (-.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))))) < -1.00000000000000006e-279Initial program 99.8%
Applied rewrites82.5%
Applied rewrites77.4%
if -1.00000000000000006e-279 < (-.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%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
rem-square-sqrt50.5
Applied rewrites50.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (sin t) eh)) (t_2 (* t (/ eh ew))))
(if (<= ew 2.1e-204)
(fabs
(fma
(/ (cos t) (sqrt (fma (* t_2 t) (/ eh ew) 1.0)))
ew
(* (* (tanh (asinh t_2)) t_1) 1.0)))
(fabs
(*
ew
(+
(/ (* (tanh (asinh (* (/ eh ew) (tan t)))) t_1) ew)
(/ (cos t) 1.0)))))))
double code(double eh, double ew, double t) {
double t_1 = sin(t) * eh;
double t_2 = t * (eh / ew);
double tmp;
if (ew <= 2.1e-204) {
tmp = fabs(fma((cos(t) / sqrt(fma((t_2 * t), (eh / ew), 1.0))), ew, ((tanh(asinh(t_2)) * t_1) * 1.0)));
} else {
tmp = fabs((ew * (((tanh(asinh(((eh / ew) * tan(t)))) * t_1) / ew) + (cos(t) / 1.0))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(sin(t) * eh) t_2 = Float64(t * Float64(eh / ew)) tmp = 0.0 if (ew <= 2.1e-204) tmp = abs(fma(Float64(cos(t) / sqrt(fma(Float64(t_2 * t), Float64(eh / ew), 1.0))), ew, Float64(Float64(tanh(asinh(t_2)) * t_1) * 1.0))); else tmp = abs(Float64(ew * Float64(Float64(Float64(tanh(asinh(Float64(Float64(eh / ew) * tan(t)))) * t_1) / ew) + Float64(cos(t) / 1.0)))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, 2.1e-204], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[(t$95$2 * t), $MachinePrecision] * N[(eh / ew), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Tanh[N[ArcSinh[t$95$2], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(N[(N[(N[Tanh[N[ArcSinh[N[(N[(eh / ew), $MachinePrecision] * N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] / ew), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin t \cdot eh\\
t_2 := t \cdot \frac{eh}{ew}\\
\mathbf{if}\;ew \leq 2.1 \cdot 10^{-204}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_2 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_2 \cdot t\_1\right) \cdot 1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(\frac{\tanh \sinh^{-1} \left(\frac{eh}{ew} \cdot \tan t\right) \cdot t\_1}{ew} + \frac{\cos t}{1}\right)\right|\\
\end{array}
\end{array}
if ew < 2.10000000000000009e-204Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in t around 0
Applied rewrites91.5%
Taylor expanded in t around 0
Applied rewrites82.0%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
Applied rewrites89.5%
if 2.10000000000000009e-204 < ew Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in eh around 0
Applied rewrites91.1%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t)))
(t_2 (atan (/ (* (- eh) (tan t)) ew)))
(t_3 (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))))
(t_4 (* t (/ eh ew))))
(if (<= t_3 -5e+50)
(fabs
(fma
(/ (cos t) (sqrt (fma (* t_4 t) (/ eh ew) 1.0)))
ew
(* (* (tanh (asinh t_4)) (* (sin t) eh)) 1.0)))
(if (<= t_3 -1e-279)
(fabs t_1)
(fma
eh
(- (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) (sin t)))
(/ (* (cos t) ew) 1.0))))))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double t_2 = atan(((-eh * tan(t)) / ew));
double t_3 = (t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2));
double t_4 = t * (eh / ew);
double tmp;
if (t_3 <= -5e+50) {
tmp = fabs(fma((cos(t) / sqrt(fma((t_4 * t), (eh / ew), 1.0))), ew, ((tanh(asinh(t_4)) * (sin(t) * eh)) * 1.0)));
} else if (t_3 <= -1e-279) {
tmp = fabs(t_1);
} else {
tmp = fma(eh, -(tanh(asinh(((tan(t) / ew) * -eh))) * sin(t)), ((cos(t) * ew) / 1.0));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) t_3 = Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2))) t_4 = Float64(t * Float64(eh / ew)) tmp = 0.0 if (t_3 <= -5e+50) tmp = abs(fma(Float64(cos(t) / sqrt(fma(Float64(t_4 * t), Float64(eh / ew), 1.0))), ew, Float64(Float64(tanh(asinh(t_4)) * Float64(sin(t) * eh)) * 1.0))); elseif (t_3 <= -1e-279) tmp = abs(t_1); else tmp = fma(eh, Float64(-Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * sin(t))), Float64(Float64(cos(t) * ew) / 1.0)); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+50], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[(t$95$4 * t), $MachinePrecision] * N[(eh / ew), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Tanh[N[ArcSinh[t$95$4], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, -1e-279], N[Abs[t$95$1], $MachinePrecision], N[(eh * (-N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]) + N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
t_3 := t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2\\
t_4 := t \cdot \frac{eh}{ew}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+50}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_4 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_4 \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)\right|\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-279}:\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, \frac{\cos t \cdot ew}{1}\right)\\
\end{array}
\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))))) < -5e50Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in t around 0
Applied rewrites91.5%
Taylor expanded in t around 0
Applied rewrites82.0%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
Applied rewrites89.5%
if -5e50 < (-.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))))) < -1.00000000000000006e-279Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in eh around 0
lower-cos.f6462.7
Applied rewrites62.7%
if -1.00000000000000006e-279 < (-.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%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
rem-square-sqrt50.5
lift--.f64N/A
sub-flipN/A
Applied rewrites50.5%
Taylor expanded in eh around 0
Applied rewrites49.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* t (/ eh ew))))
(if (<= ew 5e+68)
(fabs
(fma
(/ (cos t) (sqrt (fma (* t_1 t) (/ eh ew) 1.0)))
ew
(* (* (tanh (asinh t_1)) (* (sin t) eh)) 1.0)))
(fabs (* ew (cos t))))))
double code(double eh, double ew, double t) {
double t_1 = t * (eh / ew);
double tmp;
if (ew <= 5e+68) {
tmp = fabs(fma((cos(t) / sqrt(fma((t_1 * t), (eh / ew), 1.0))), ew, ((tanh(asinh(t_1)) * (sin(t) * eh)) * 1.0)));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(t * Float64(eh / ew)) tmp = 0.0 if (ew <= 5e+68) tmp = abs(fma(Float64(cos(t) / sqrt(fma(Float64(t_1 * t), Float64(eh / ew), 1.0))), ew, Float64(Float64(tanh(asinh(t_1)) * Float64(sin(t) * eh)) * 1.0))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ew, 5e+68], N[Abs[N[(N[(N[Cos[t], $MachinePrecision] / N[Sqrt[N[(N[(t$95$1 * t), $MachinePrecision] * N[(eh / ew), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew + N[(N[(N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{eh}{ew}\\
\mathbf{if}\;ew \leq 5 \cdot 10^{+68}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{\cos t}{\sqrt{\mathsf{fma}\left(t\_1 \cdot t, \frac{eh}{ew}, 1\right)}}, ew, \left(\tanh \sinh^{-1} t\_1 \cdot \left(\sin t \cdot eh\right)\right) \cdot 1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if ew < 5.0000000000000004e68Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in t around 0
Applied rewrites91.5%
Taylor expanded in t around 0
Applied rewrites82.0%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
Applied rewrites89.5%
if 5.0000000000000004e68 < ew Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in eh around 0
lower-cos.f6462.7
Applied rewrites62.7%
(FPCore (eh ew t)
:precision binary64
(if (<= t 0.8)
(fma
eh
(- (* (tanh (asinh (* (/ (tan t) ew) (- eh)))) (sin t)))
(+ ew (* (pow t 2.0) (* -0.5 ew))))
(fabs (* ew (cos t)))))
double code(double eh, double ew, double t) {
double tmp;
if (t <= 0.8) {
tmp = fma(eh, -(tanh(asinh(((tan(t) / ew) * -eh))) * sin(t)), (ew + (pow(t, 2.0) * (-0.5 * ew))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (t <= 0.8) tmp = fma(eh, Float64(-Float64(tanh(asinh(Float64(Float64(tan(t) / ew) * Float64(-eh)))) * sin(t))), Float64(ew + Float64((t ^ 2.0) * Float64(-0.5 * ew)))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[t, 0.8], N[(eh * (-N[(N[Tanh[N[ArcSinh[N[(N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision] * (-eh)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]) + N[(ew + N[(N[Power[t, 2.0], $MachinePrecision] * N[(-0.5 * ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.8:\\
\;\;\;\;\mathsf{fma}\left(eh, -\tanh \sinh^{-1} \left(\frac{\tan t}{ew} \cdot \left(-eh\right)\right) \cdot \sin t, ew + {t}^{2} \cdot \left(-0.5 \cdot ew\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if t < 0.80000000000000004Initial program 99.8%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
rem-square-sqrt50.5
lift--.f64N/A
sub-flipN/A
Applied rewrites50.5%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6418.0
Applied rewrites18.0%
Taylor expanded in eh around 0
lower-*.f6430.0
Applied rewrites30.0%
if 0.80000000000000004 < t Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in eh around 0
lower-cos.f6462.7
Applied rewrites62.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (asinh (* (/ eh ew) t))))
(if (<= t 0.8)
(fabs
(*
ew
(+
(/ (* (tanh t_1) (* (sin t) eh)) ew)
(/ (+ 1.0 (* -0.5 (pow t 2.0))) (cosh t_1)))))
(fabs (* ew (cos t))))))
double code(double eh, double ew, double t) {
double t_1 = asinh(((eh / ew) * t));
double tmp;
if (t <= 0.8) {
tmp = fabs((ew * (((tanh(t_1) * (sin(t) * eh)) / ew) + ((1.0 + (-0.5 * pow(t, 2.0))) / cosh(t_1)))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.asinh(((eh / ew) * t)) tmp = 0 if t <= 0.8: tmp = math.fabs((ew * (((math.tanh(t_1) * (math.sin(t) * eh)) / ew) + ((1.0 + (-0.5 * math.pow(t, 2.0))) / math.cosh(t_1))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) t_1 = asinh(Float64(Float64(eh / ew) * t)) tmp = 0.0 if (t <= 0.8) tmp = abs(Float64(ew * Float64(Float64(Float64(tanh(t_1) * Float64(sin(t) * eh)) / ew) + Float64(Float64(1.0 + Float64(-0.5 * (t ^ 2.0))) / cosh(t_1))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = asinh(((eh / ew) * t)); tmp = 0.0; if (t <= 0.8) tmp = abs((ew * (((tanh(t_1) * (sin(t) * eh)) / ew) + ((1.0 + (-0.5 * (t ^ 2.0))) / cosh(t_1))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(N[(eh / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.8], N[Abs[N[(ew * N[(N[(N[(N[Tanh[t$95$1], $MachinePrecision] * N[(N[Sin[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[(N[(1.0 + N[(-0.5 * N[Power[t, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)\\
\mathbf{if}\;t \leq 0.8:\\
\;\;\;\;\left|ew \cdot \left(\frac{\tanh t\_1 \cdot \left(\sin t \cdot eh\right)}{ew} + \frac{1 + -0.5 \cdot {t}^{2}}{\cosh t\_1}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if t < 0.80000000000000004Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in t around 0
Applied rewrites91.5%
Taylor expanded in t around 0
Applied rewrites82.0%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6457.5
Applied rewrites57.5%
if 0.80000000000000004 < t Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in eh around 0
lower-cos.f6462.7
Applied rewrites62.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (asinh (* (/ eh ew) t))))
(if (<= t 3.2e+14)
(fabs (* ew (+ (/ (* (tanh t_1) (* t eh)) ew) (/ (cos t) (cosh t_1)))))
(fabs (* ew (cos t))))))
double code(double eh, double ew, double t) {
double t_1 = asinh(((eh / ew) * t));
double tmp;
if (t <= 3.2e+14) {
tmp = fabs((ew * (((tanh(t_1) * (t * eh)) / ew) + (cos(t) / cosh(t_1)))));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
def code(eh, ew, t): t_1 = math.asinh(((eh / ew) * t)) tmp = 0 if t <= 3.2e+14: tmp = math.fabs((ew * (((math.tanh(t_1) * (t * eh)) / ew) + (math.cos(t) / math.cosh(t_1))))) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) t_1 = asinh(Float64(Float64(eh / ew) * t)) tmp = 0.0 if (t <= 3.2e+14) tmp = abs(Float64(ew * Float64(Float64(Float64(tanh(t_1) * Float64(t * eh)) / ew) + Float64(cos(t) / cosh(t_1))))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = asinh(((eh / ew) * t)); tmp = 0.0; if (t <= 3.2e+14) tmp = abs((ew * (((tanh(t_1) * (t * eh)) / ew) + (cos(t) / cosh(t_1))))); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcSinh[N[(N[(eh / ew), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.2e+14], N[Abs[N[(ew * N[(N[(N[(N[Tanh[t$95$1], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision] + N[(N[Cos[t], $MachinePrecision] / N[Cosh[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sinh^{-1} \left(\frac{eh}{ew} \cdot t\right)\\
\mathbf{if}\;t \leq 3.2 \cdot 10^{+14}:\\
\;\;\;\;\left|ew \cdot \left(\frac{\tanh t\_1 \cdot \left(t \cdot eh\right)}{ew} + \frac{\cos t}{\cosh t\_1}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if t < 3.2e14Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in t around 0
Applied rewrites91.5%
Taylor expanded in t around 0
Applied rewrites82.0%
Taylor expanded in t around 0
Applied rewrites64.5%
if 3.2e14 < t Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in eh around 0
lower-cos.f6462.7
Applied rewrites62.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (/ t ew) (- eh))))
(if (<= t 1.6)
(/ (- (* (cos t) ew) (* t_1 (* eh t))) (cosh (asinh t_1)))
(fabs (* ew (cos t))))))
double code(double eh, double ew, double t) {
double t_1 = (t / ew) * -eh;
double tmp;
if (t <= 1.6) {
tmp = ((cos(t) * ew) - (t_1 * (eh * t))) / cosh(asinh(t_1));
} else {
tmp = fabs((ew * cos(t)));
}
return tmp;
}
def code(eh, ew, t): t_1 = (t / ew) * -eh tmp = 0 if t <= 1.6: tmp = ((math.cos(t) * ew) - (t_1 * (eh * t))) / math.cosh(math.asinh(t_1)) else: tmp = math.fabs((ew * math.cos(t))) return tmp
function code(eh, ew, t) t_1 = Float64(Float64(t / ew) * Float64(-eh)) tmp = 0.0 if (t <= 1.6) tmp = Float64(Float64(Float64(cos(t) * ew) - Float64(t_1 * Float64(eh * t))) / cosh(asinh(t_1))); else tmp = abs(Float64(ew * cos(t))); end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = (t / ew) * -eh; tmp = 0.0; if (t <= 1.6) tmp = ((cos(t) * ew) - (t_1 * (eh * t))) / cosh(asinh(t_1)); else tmp = abs((ew * cos(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(t / ew), $MachinePrecision] * (-eh)), $MachinePrecision]}, If[LessEqual[t, 1.6], N[(N[(N[(N[Cos[t], $MachinePrecision] * ew), $MachinePrecision] - N[(t$95$1 * N[(eh * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cosh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{ew} \cdot \left(-eh\right)\\
\mathbf{if}\;t \leq 1.6:\\
\;\;\;\;\frac{\cos t \cdot ew - t\_1 \cdot \left(eh \cdot t\right)}{\cosh \sinh^{-1} t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \cos t\right|\\
\end{array}
\end{array}
if t < 1.6000000000000001Initial program 99.8%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
rem-square-sqrt50.5
lift--.f64N/A
Applied rewrites42.3%
Taylor expanded in t around 0
lower-/.f6433.1
Applied rewrites33.1%
Taylor expanded in t around 0
lower-/.f6432.9
Applied rewrites32.9%
Taylor expanded in t around 0
lower-*.f6431.1
Applied rewrites31.1%
if 1.6000000000000001 < t Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in eh around 0
lower-cos.f6462.7
Applied rewrites62.7%
(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]
\begin{array}{l}
\\
\left|ew \cdot \cos t\right|
\end{array}
Initial program 99.8%
Taylor expanded in ew around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.3%
Applied rewrites92.3%
Taylor expanded in eh around 0
lower-cos.f6462.7
Applied rewrites62.7%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* ew (cos t))) (t_2 (atan (/ (* (- eh) (tan t)) ew))))
(if (<= (- (* t_1 (cos t_2)) (* (* eh (sin t)) (sin t_2))) 1e-224)
(* ew (/ (/ 1.0 ew) (fabs (/ 1.0 ew))))
t_1)))
double code(double eh, double ew, double t) {
double t_1 = ew * cos(t);
double t_2 = atan(((-eh * tan(t)) / ew));
double tmp;
if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 1e-224) {
tmp = ew * ((1.0 / ew) / fabs((1.0 / ew)));
} 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) :: t_2
real(8) :: tmp
t_1 = ew * cos(t)
t_2 = atan(((-eh * tan(t)) / ew))
if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 1d-224) then
tmp = ew * ((1.0d0 / ew) / abs((1.0d0 / ew)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double t_1 = ew * Math.cos(t);
double t_2 = Math.atan(((-eh * Math.tan(t)) / ew));
double tmp;
if (((t_1 * Math.cos(t_2)) - ((eh * Math.sin(t)) * Math.sin(t_2))) <= 1e-224) {
tmp = ew * ((1.0 / ew) / Math.abs((1.0 / ew)));
} else {
tmp = t_1;
}
return tmp;
}
def code(eh, ew, t): t_1 = ew * math.cos(t) t_2 = math.atan(((-eh * math.tan(t)) / ew)) tmp = 0 if ((t_1 * math.cos(t_2)) - ((eh * math.sin(t)) * math.sin(t_2))) <= 1e-224: tmp = ew * ((1.0 / ew) / math.fabs((1.0 / ew))) else: tmp = t_1 return tmp
function code(eh, ew, t) t_1 = Float64(ew * cos(t)) t_2 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew)) tmp = 0.0 if (Float64(Float64(t_1 * cos(t_2)) - Float64(Float64(eh * sin(t)) * sin(t_2))) <= 1e-224) tmp = Float64(ew * Float64(Float64(1.0 / ew) / abs(Float64(1.0 / ew)))); else tmp = t_1; end return tmp end
function tmp_2 = code(eh, ew, t) t_1 = ew * cos(t); t_2 = atan(((-eh * tan(t)) / ew)); tmp = 0.0; if (((t_1 * cos(t_2)) - ((eh * sin(t)) * sin(t_2))) <= 1e-224) tmp = ew * ((1.0 / ew) / abs((1.0 / ew))); else tmp = t_1; end tmp_2 = tmp; end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-224], N[(ew * N[(N[(1.0 / ew), $MachinePrecision] / N[Abs[N[(1.0 / ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ew \cdot \cos t\\
t_2 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\mathbf{if}\;t\_1 \cdot \cos t\_2 - \left(eh \cdot \sin t\right) \cdot \sin t\_2 \leq 10^{-224}:\\
\;\;\;\;ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\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))))) < 1e-224Initial program 99.8%
Applied rewrites82.5%
Taylor expanded in t around 0
lower-/.f6442.8
Applied rewrites42.8%
lift-/.f64N/A
rgt-mult-inverseN/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6442.9
Applied rewrites42.9%
if 1e-224 < (-.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%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
rem-square-sqrt50.5
lift--.f64N/A
Applied rewrites42.3%
Taylor expanded in eh around 0
lower-*.f64N/A
lower-cos.f6432.3
Applied rewrites32.3%
(FPCore (eh ew t) :precision binary64 (* ew (/ (/ 1.0 ew) (fabs (/ 1.0 ew)))))
double code(double eh, double ew, double t) {
return ew * ((1.0 / ew) / fabs((1.0 / 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 = ew * ((1.0d0 / ew) / abs((1.0d0 / ew)))
end function
public static double code(double eh, double ew, double t) {
return ew * ((1.0 / ew) / Math.abs((1.0 / ew)));
}
def code(eh, ew, t): return ew * ((1.0 / ew) / math.fabs((1.0 / ew)))
function code(eh, ew, t) return Float64(ew * Float64(Float64(1.0 / ew) / abs(Float64(1.0 / ew)))) end
function tmp = code(eh, ew, t) tmp = ew * ((1.0 / ew) / abs((1.0 / ew))); end
code[eh_, ew_, t_] := N[(ew * N[(N[(1.0 / ew), $MachinePrecision] / N[Abs[N[(1.0 / ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
ew \cdot \frac{\frac{1}{ew}}{\left|\frac{1}{ew}\right|}
\end{array}
Initial program 99.8%
Applied rewrites82.5%
Taylor expanded in t around 0
lower-/.f6442.8
Applied rewrites42.8%
lift-/.f64N/A
rgt-mult-inverseN/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6442.9
Applied rewrites42.9%
(FPCore (eh ew t) :precision binary64 (/ ew (* ew (fabs (/ 1.0 ew)))))
double code(double eh, double ew, double t) {
return ew / (ew * fabs((1.0 / 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 = ew / (ew * abs((1.0d0 / ew)))
end function
public static double code(double eh, double ew, double t) {
return ew / (ew * Math.abs((1.0 / ew)));
}
def code(eh, ew, t): return ew / (ew * math.fabs((1.0 / ew)))
function code(eh, ew, t) return Float64(ew / Float64(ew * abs(Float64(1.0 / ew)))) end
function tmp = code(eh, ew, t) tmp = ew / (ew * abs((1.0 / ew))); end
code[eh_, ew_, t_] := N[(ew / N[(ew * N[Abs[N[(1.0 / ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{ew}{ew \cdot \left|\frac{1}{ew}\right|}
\end{array}
Initial program 99.8%
Applied rewrites82.5%
Taylor expanded in t around 0
lower-/.f6442.8
Applied rewrites42.8%
lift-/.f64N/A
rgt-mult-inverseN/A
mult-flip-revN/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
(FPCore (eh ew t) :precision binary64 (/ 1.0 (fabs (/ 1.0 ew))))
double code(double eh, double ew, double t) {
return 1.0 / fabs((1.0 / 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 = 1.0d0 / abs((1.0d0 / ew))
end function
public static double code(double eh, double ew, double t) {
return 1.0 / Math.abs((1.0 / ew));
}
def code(eh, ew, t): return 1.0 / math.fabs((1.0 / ew))
function code(eh, ew, t) return Float64(1.0 / abs(Float64(1.0 / ew))) end
function tmp = code(eh, ew, t) tmp = 1.0 / abs((1.0 / ew)); end
code[eh_, ew_, t_] := N[(1.0 / N[Abs[N[(1.0 / ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\left|\frac{1}{ew}\right|}
\end{array}
Initial program 99.8%
Applied rewrites82.5%
Taylor expanded in t around 0
lower-/.f6442.8
Applied rewrites42.8%
herbie shell --seed 2025149
(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)))))))