
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((eh / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((eh / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) eh)) (t_2 (/ t_1 (* (sin t) ew))))
(fabs
(fma
(* (/ 1.0 (sqrt (+ 1.0 (pow t_2 2.0)))) ew)
(sin t)
(* t_1 (tanh (asinh t_2)))))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * eh;
double t_2 = t_1 / (sin(t) * ew);
return fabs(fma(((1.0 / sqrt((1.0 + pow(t_2, 2.0)))) * ew), sin(t), (t_1 * tanh(asinh(t_2)))));
}
function code(eh, ew, t) t_1 = Float64(cos(t) * eh) t_2 = Float64(t_1 / Float64(sin(t) * ew)) return abs(fma(Float64(Float64(1.0 / sqrt(Float64(1.0 + (t_2 ^ 2.0)))) * ew), sin(t), Float64(t_1 * tanh(asinh(t_2))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[(1.0 / N[Sqrt[N[(1.0 + N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * ew), $MachinePrecision] * N[Sin[t], $MachinePrecision] + N[(t$95$1 * N[Tanh[N[ArcSinh[t$95$2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot eh\\
t_2 := \frac{t\_1}{\sin t \cdot ew}\\
\left|\mathsf{fma}\left(\frac{1}{\sqrt{1 + {t\_2}^{2}}} \cdot ew, \sin t, t\_1 \cdot \tanh \sinh^{-1} t\_2\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (atan (/ (/ eh ew) (tan t))))) (fabs (+ (* (* ew (sin t)) (cos t_1)) (* (* eh (cos t)) (sin t_1))))))
double code(double eh, double ew, double t) {
double t_1 = atan(((eh / ew) / tan(t)));
return fabs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
real(8) :: t_1
t_1 = atan(((eh / ew) / tan(t)))
code = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
double t_1 = Math.atan(((eh / ew) / Math.tan(t)));
return Math.abs((((ew * Math.sin(t)) * Math.cos(t_1)) + ((eh * Math.cos(t)) * Math.sin(t_1))));
}
def code(eh, ew, t): t_1 = math.atan(((eh / ew) / math.tan(t))) return math.fabs((((ew * math.sin(t)) * math.cos(t_1)) + ((eh * math.cos(t)) * math.sin(t_1))))
function code(eh, ew, t) t_1 = atan(Float64(Float64(eh / ew) / tan(t))) return abs(Float64(Float64(Float64(ew * sin(t)) * cos(t_1)) + Float64(Float64(eh * cos(t)) * sin(t_1)))) end
function tmp = code(eh, ew, t) t_1 = atan(((eh / ew) / tan(t))); tmp = abs((((ew * sin(t)) * cos(t_1)) + ((eh * cos(t)) * sin(t_1)))); end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
\left|\left(ew \cdot \sin t\right) \cdot \cos t\_1 + \left(eh \cdot \cos t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}
Initial program 99.8%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (/ eh (* ew (tan t)))))
(fabs
(fma
(* (sin t) ew)
(/ 1.0 (sqrt (+ 1.0 (pow t_1 2.0))))
(* (* (cos t) eh) (tanh (asinh t_1)))))))
double code(double eh, double ew, double t) {
double t_1 = eh / (ew * tan(t));
return fabs(fma((sin(t) * ew), (1.0 / sqrt((1.0 + pow(t_1, 2.0)))), ((cos(t) * eh) * tanh(asinh(t_1)))));
}
function code(eh, ew, t) t_1 = Float64(eh / Float64(ew * tan(t))) return abs(fma(Float64(sin(t) * ew), Float64(1.0 / sqrt(Float64(1.0 + (t_1 ^ 2.0)))), Float64(Float64(cos(t) * eh) * tanh(asinh(t_1))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(1.0 + N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Tanh[N[ArcSinh[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{eh}{ew \cdot \tan t}\\
\left|\mathsf{fma}\left(\sin t \cdot ew, \frac{1}{\sqrt{1 + {t\_1}^{2}}}, \left(\cos t \cdot eh\right) \cdot \tanh \sinh^{-1} t\_1\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Applied rewrites99.8%
(FPCore (eh ew t) :precision binary64 (let* ((t_1 (* (cos t) eh))) (fabs (fma ew (sin t) (* t_1 (tanh (asinh (/ t_1 (* (sin t) ew)))))))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * eh;
return fabs(fma(ew, sin(t), (t_1 * tanh(asinh((t_1 / (sin(t) * ew)))))));
}
function code(eh, ew, t) t_1 = Float64(cos(t) * eh) return abs(fma(ew, sin(t), Float64(t_1 * tanh(asinh(Float64(t_1 / Float64(sin(t) * ew))))))) end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, N[Abs[N[(ew * N[Sin[t], $MachinePrecision] + N[(t$95$1 * N[Tanh[N[ArcSinh[N[(t$95$1 / N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot eh\\
\left|\mathsf{fma}\left(ew, \sin t, t\_1 \cdot \tanh \sinh^{-1} \left(\frac{t\_1}{\sin t \cdot ew}\right)\right)\right|
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
Applied rewrites98.5%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* eh (cos t)))
(t_2 (* ew (sin t)))
(t_3 (atan (/ (/ eh ew) (tan t))))
(t_4 (/ eh (* t ew))))
(if (<= (fabs (+ (* t_2 (cos t_3)) (* t_1 (sin t_3)))) 5e+42)
(fabs
(fma
(* 1.0 ew)
(sin t)
(*
(* (cos t) eh)
(tanh
(asinh
(/
(fma
(* t t)
(- (* -0.5 (/ eh ew)) (* -0.16666666666666666 (/ eh ew)))
(/ eh ew))
t))))))
(fabs
(+
(* t_2 (/ 1.0 (sqrt (+ 1.0 (* t_4 t_4)))))
(* t_1 (sin (atan t_4))))))))
double code(double eh, double ew, double t) {
double t_1 = eh * cos(t);
double t_2 = ew * sin(t);
double t_3 = atan(((eh / ew) / tan(t)));
double t_4 = eh / (t * ew);
double tmp;
if (fabs(((t_2 * cos(t_3)) + (t_1 * sin(t_3)))) <= 5e+42) {
tmp = fabs(fma((1.0 * ew), sin(t), ((cos(t) * eh) * tanh(asinh((fma((t * t), ((-0.5 * (eh / ew)) - (-0.16666666666666666 * (eh / ew))), (eh / ew)) / t))))));
} else {
tmp = fabs(((t_2 * (1.0 / sqrt((1.0 + (t_4 * t_4))))) + (t_1 * sin(atan(t_4)))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(eh * cos(t)) t_2 = Float64(ew * sin(t)) t_3 = atan(Float64(Float64(eh / ew) / tan(t))) t_4 = Float64(eh / Float64(t * ew)) tmp = 0.0 if (abs(Float64(Float64(t_2 * cos(t_3)) + Float64(t_1 * sin(t_3)))) <= 5e+42) tmp = abs(fma(Float64(1.0 * ew), sin(t), Float64(Float64(cos(t) * eh) * tanh(asinh(Float64(fma(Float64(t * t), Float64(Float64(-0.5 * Float64(eh / ew)) - Float64(-0.16666666666666666 * Float64(eh / ew))), Float64(eh / ew)) / t)))))); else tmp = abs(Float64(Float64(t_2 * Float64(1.0 / sqrt(Float64(1.0 + Float64(t_4 * t_4))))) + Float64(t_1 * sin(atan(t_4))))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(eh / N[(t * ew), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[N[(N[(t$95$2 * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 5e+42], N[Abs[N[(N[(1.0 * ew), $MachinePrecision] * N[Sin[t], $MachinePrecision] + N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Tanh[N[ArcSinh[N[(N[(N[(t * t), $MachinePrecision] * N[(N[(-0.5 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] - N[(-0.16666666666666666 * N[(eh / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(t$95$2 * N[(1.0 / N[Sqrt[N[(1.0 + N[(t$95$4 * t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Sin[N[ArcTan[t$95$4], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
t_2 := ew \cdot \sin t\\
t_3 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
t_4 := \frac{eh}{t \cdot ew}\\
\mathbf{if}\;\left|t\_2 \cdot \cos t\_3 + t\_1 \cdot \sin t\_3\right| \leq 5 \cdot 10^{+42}:\\
\;\;\;\;\left|\mathsf{fma}\left(1 \cdot ew, \sin t, \left(\cos t \cdot eh\right) \cdot \tanh \sinh^{-1} \left(\frac{\mathsf{fma}\left(t \cdot t, -0.5 \cdot \frac{eh}{ew} - -0.16666666666666666 \cdot \frac{eh}{ew}, \frac{eh}{ew}\right)}{t}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_2 \cdot \frac{1}{\sqrt{1 + t\_4 \cdot t\_4}} + t\_1 \cdot \sin \tan^{-1} t\_4\right|\\
\end{array}
\end{array}
if (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) < 5.00000000000000007e42Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6472.3
Applied rewrites72.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6472.4
Applied rewrites72.4%
Taylor expanded in eh around 0
Applied rewrites82.9%
if 5.00000000000000007e42 < (fabs.f64 (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))) Initial program 99.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.9
Applied rewrites89.9%
lift-cos.f64N/A
lift-atan.f64N/A
cos-atanN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
lower-*.f6489.9
Applied rewrites89.9%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) eh)))
(if (<= eh 1.5e+189)
(fabs
(fma
(* 1.0 ew)
(sin t)
(*
t_1
(tanh
(asinh
(/
(fma
(* t t)
(- (* -0.5 (/ eh ew)) (* -0.16666666666666666 (/ eh ew)))
(/ eh ew))
t))))))
(fabs
(fma
ew
t
(*
t_1
(tanh
(+
(log (+ (/ (fabs eh) (sqrt (* ew ew))) (/ eh ew)))
(* -1.0 (log t))))))))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * eh;
double tmp;
if (eh <= 1.5e+189) {
tmp = fabs(fma((1.0 * ew), sin(t), (t_1 * tanh(asinh((fma((t * t), ((-0.5 * (eh / ew)) - (-0.16666666666666666 * (eh / ew))), (eh / ew)) / t))))));
} else {
tmp = fabs(fma(ew, t, (t_1 * tanh((log(((fabs(eh) / sqrt((ew * ew))) + (eh / ew))) + (-1.0 * log(t)))))));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(cos(t) * eh) tmp = 0.0 if (eh <= 1.5e+189) tmp = abs(fma(Float64(1.0 * ew), sin(t), Float64(t_1 * tanh(asinh(Float64(fma(Float64(t * t), Float64(Float64(-0.5 * Float64(eh / ew)) - Float64(-0.16666666666666666 * Float64(eh / ew))), Float64(eh / ew)) / t)))))); else tmp = abs(fma(ew, t, Float64(t_1 * tanh(Float64(log(Float64(Float64(abs(eh) / sqrt(Float64(ew * ew))) + Float64(eh / ew))) + Float64(-1.0 * log(t))))))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[eh, 1.5e+189], N[Abs[N[(N[(1.0 * ew), $MachinePrecision] * N[Sin[t], $MachinePrecision] + N[(t$95$1 * N[Tanh[N[ArcSinh[N[(N[(N[(t * t), $MachinePrecision] * N[(N[(-0.5 * N[(eh / ew), $MachinePrecision]), $MachinePrecision] - N[(-0.16666666666666666 * N[(eh / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * t + N[(t$95$1 * N[Tanh[N[(N[Log[N[(N[(N[Abs[eh], $MachinePrecision] / N[Sqrt[N[(ew * ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(-1.0 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot eh\\
\mathbf{if}\;eh \leq 1.5 \cdot 10^{+189}:\\
\;\;\;\;\left|\mathsf{fma}\left(1 \cdot ew, \sin t, t\_1 \cdot \tanh \sinh^{-1} \left(\frac{\mathsf{fma}\left(t \cdot t, -0.5 \cdot \frac{eh}{ew} - -0.16666666666666666 \cdot \frac{eh}{ew}, \frac{eh}{ew}\right)}{t}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(ew, t, t\_1 \cdot \tanh \left(\log \left(\frac{\left|eh\right|}{\sqrt{ew \cdot ew}} + \frac{eh}{ew}\right) + -1 \cdot \log t\right)\right)\right|\\
\end{array}
\end{array}
if eh < 1.4999999999999999e189Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6472.3
Applied rewrites72.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6472.4
Applied rewrites72.4%
Taylor expanded in eh around 0
Applied rewrites82.9%
if 1.4999999999999999e189 < eh Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
Applied rewrites98.5%
Taylor expanded in t around 0
Applied rewrites64.9%
Taylor expanded in t around 0
Applied rewrites64.9%
Taylor expanded in t around 0
lower-+.f64N/A
lower-log.f64N/A
lower-+.f64N/A
sqrt-divN/A
lower-/.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lower-log.f6426.6
Applied rewrites26.6%
(FPCore (eh ew t)
:precision binary64
(let* ((t_1 (* (cos t) eh)))
(if (<= t 0.0215)
(fabs (fma ew t (* t_1 (tanh (asinh (/ t_1 (* t ew)))))))
(fabs (* ew (sin t))))))
double code(double eh, double ew, double t) {
double t_1 = cos(t) * eh;
double tmp;
if (t <= 0.0215) {
tmp = fabs(fma(ew, t, (t_1 * tanh(asinh((t_1 / (t * ew)))))));
} else {
tmp = fabs((ew * sin(t)));
}
return tmp;
}
function code(eh, ew, t) t_1 = Float64(cos(t) * eh) tmp = 0.0 if (t <= 0.0215) tmp = abs(fma(ew, t, Float64(t_1 * tanh(asinh(Float64(t_1 / Float64(t * ew))))))); else tmp = abs(Float64(ew * sin(t))); end return tmp end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]}, If[LessEqual[t, 0.0215], N[Abs[N[(ew * t + N[(t$95$1 * N[Tanh[N[ArcSinh[N[(t$95$1 / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos t \cdot eh\\
\mathbf{if}\;t \leq 0.0215:\\
\;\;\;\;\left|\mathsf{fma}\left(ew, t, t\_1 \cdot \tanh \sinh^{-1} \left(\frac{t\_1}{t \cdot ew}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\
\end{array}
\end{array}
if t < 0.021499999999999998Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
Applied rewrites98.5%
Taylor expanded in t around 0
Applied rewrites64.9%
Taylor expanded in t around 0
Applied rewrites64.9%
if 0.021499999999999998 < t Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
(FPCore (eh ew t)
:precision binary64
(if (<= t 0.0215)
(fabs
(fma
ew
t
(*
(* (cos t) eh)
(tanh
(+
(log (+ (/ (fabs eh) (sqrt (* ew ew))) (/ eh ew)))
(* -1.0 (log t)))))))
(fabs (* ew (sin t)))))
double code(double eh, double ew, double t) {
double tmp;
if (t <= 0.0215) {
tmp = fabs(fma(ew, t, ((cos(t) * eh) * tanh((log(((fabs(eh) / sqrt((ew * ew))) + (eh / ew))) + (-1.0 * log(t)))))));
} else {
tmp = fabs((ew * sin(t)));
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (t <= 0.0215) tmp = abs(fma(ew, t, Float64(Float64(cos(t) * eh) * tanh(Float64(log(Float64(Float64(abs(eh) / sqrt(Float64(ew * ew))) + Float64(eh / ew))) + Float64(-1.0 * log(t))))))); else tmp = abs(Float64(ew * sin(t))); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[t, 0.0215], N[Abs[N[(ew * t + N[(N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision] * N[Tanh[N[(N[Log[N[(N[(N[Abs[eh], $MachinePrecision] / N[Sqrt[N[(ew * ew), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(eh / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(-1.0 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0215:\\
\;\;\;\;\left|\mathsf{fma}\left(ew, t, \left(\cos t \cdot eh\right) \cdot \tanh \left(\log \left(\frac{\left|eh\right|}{\sqrt{ew \cdot ew}} + \frac{eh}{ew}\right) + -1 \cdot \log t\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\
\end{array}
\end{array}
if t < 0.021499999999999998Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
Applied rewrites98.5%
Taylor expanded in t around 0
Applied rewrites64.9%
Taylor expanded in t around 0
Applied rewrites64.9%
Taylor expanded in t around 0
lower-+.f64N/A
lower-log.f64N/A
lower-+.f64N/A
sqrt-divN/A
lower-/.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lower-log.f6426.6
Applied rewrites26.6%
if 0.021499999999999998 < t Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
(FPCore (eh ew t) :precision binary64 (if (<= t 6.8e-62) (fabs (* (tanh (asinh (/ (* (+ 1.0 (* -0.5 (* t t))) eh) (* t ew)))) eh)) (fabs (* ew (sin t)))))
double code(double eh, double ew, double t) {
double tmp;
if (t <= 6.8e-62) {
tmp = fabs((tanh(asinh((((1.0 + (-0.5 * (t * t))) * eh) / (t * ew)))) * eh));
} else {
tmp = fabs((ew * sin(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if t <= 6.8e-62: tmp = math.fabs((math.tanh(math.asinh((((1.0 + (-0.5 * (t * t))) * eh) / (t * ew)))) * eh)) else: tmp = math.fabs((ew * math.sin(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if (t <= 6.8e-62) tmp = abs(Float64(tanh(asinh(Float64(Float64(Float64(1.0 + Float64(-0.5 * Float64(t * t))) * eh) / Float64(t * ew)))) * eh)); else tmp = abs(Float64(ew * sin(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (t <= 6.8e-62) tmp = abs((tanh(asinh((((1.0 + (-0.5 * (t * t))) * eh) / (t * ew)))) * eh)); else tmp = abs((ew * sin(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[t, 6.8e-62], N[Abs[N[(N[Tanh[N[ArcSinh[N[(N[(N[(1.0 + N[(-0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision] / N[(t * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.8 \cdot 10^{-62}:\\
\;\;\;\;\left|\tanh \sinh^{-1} \left(\frac{\left(1 + -0.5 \cdot \left(t \cdot t\right)\right) \cdot eh}{t \cdot ew}\right) \cdot eh\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\
\end{array}
\end{array}
if t < 6.79999999999999975e-62Initial program 99.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites40.9%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6441.1
Applied rewrites41.1%
Taylor expanded in t around 0
Applied rewrites40.3%
if 6.79999999999999975e-62 < t Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
(FPCore (eh ew t)
:precision binary64
(if (<= ew 7.5e-155)
(fabs (/ (* eh eh) (fabs eh)))
(if (<= ew 1.86e-38)
(fabs (/ eh (* ew (sqrt (/ 1.0 (* ew ew))))))
(fabs (* ew (sin t))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = fabs(((eh * eh) / fabs(eh)));
} else if (ew <= 1.86e-38) {
tmp = fabs((eh / (ew * sqrt((1.0 / (ew * ew))))));
} else {
tmp = fabs((ew * sin(t)));
}
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) :: tmp
if (ew <= 7.5d-155) then
tmp = abs(((eh * eh) / abs(eh)))
else if (ew <= 1.86d-38) then
tmp = abs((eh / (ew * sqrt((1.0d0 / (ew * ew))))))
else
tmp = abs((ew * sin(t)))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = Math.abs(((eh * eh) / Math.abs(eh)));
} else if (ew <= 1.86e-38) {
tmp = Math.abs((eh / (ew * Math.sqrt((1.0 / (ew * ew))))));
} else {
tmp = Math.abs((ew * Math.sin(t)));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 7.5e-155: tmp = math.fabs(((eh * eh) / math.fabs(eh))) elif ew <= 1.86e-38: tmp = math.fabs((eh / (ew * math.sqrt((1.0 / (ew * ew)))))) else: tmp = math.fabs((ew * math.sin(t))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 7.5e-155) tmp = abs(Float64(Float64(eh * eh) / abs(eh))); elseif (ew <= 1.86e-38) tmp = abs(Float64(eh / Float64(ew * sqrt(Float64(1.0 / Float64(ew * ew)))))); else tmp = abs(Float64(ew * sin(t))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 7.5e-155) tmp = abs(((eh * eh) / abs(eh))); elseif (ew <= 1.86e-38) tmp = abs((eh / (ew * sqrt((1.0 / (ew * ew)))))); else tmp = abs((ew * sin(t))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 7.5e-155], N[Abs[N[(N[(eh * eh), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.86e-38], N[Abs[N[(eh / N[(ew * N[Sqrt[N[(1.0 / N[(ew * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 7.5 \cdot 10^{-155}:\\
\;\;\;\;\left|\frac{eh \cdot eh}{\left|eh\right|}\right|\\
\mathbf{elif}\;ew \leq 1.86 \cdot 10^{-38}:\\
\;\;\;\;\left|\frac{eh}{ew \cdot \sqrt{\frac{1}{ew \cdot ew}}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\
\end{array}
\end{array}
if ew < 7.5000000000000006e-155Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in ew around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6421.5
Applied rewrites21.5%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-sqrt-squareN/A
lower-fabs.f6424.2
Applied rewrites24.2%
if 7.5000000000000006e-155 < ew < 1.85999999999999995e-38Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6424.1
Applied rewrites24.1%
if 1.85999999999999995e-38 < ew Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
(FPCore (eh ew t)
:precision binary64
(if (<= ew 7.5e-155)
(fabs (/ (* eh eh) (fabs eh)))
(if (<= ew 4e+110)
(fabs (/ eh (* ew (sqrt (/ 1.0 (* ew ew))))))
(fabs
(*
ew
(*
t
(+
1.0
(*
(* t t)
(-
(*
(* t t)
(+ 0.008333333333333333 (* -0.0001984126984126984 (* t t))))
0.16666666666666666)))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = fabs(((eh * eh) / fabs(eh)));
} else if (ew <= 4e+110) {
tmp = fabs((eh / (ew * sqrt((1.0 / (ew * ew))))));
} else {
tmp = fabs((ew * (t * (1.0 + ((t * t) * (((t * t) * (0.008333333333333333 + (-0.0001984126984126984 * (t * t)))) - 0.16666666666666666))))));
}
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) :: tmp
if (ew <= 7.5d-155) then
tmp = abs(((eh * eh) / abs(eh)))
else if (ew <= 4d+110) then
tmp = abs((eh / (ew * sqrt((1.0d0 / (ew * ew))))))
else
tmp = abs((ew * (t * (1.0d0 + ((t * t) * (((t * t) * (0.008333333333333333d0 + ((-0.0001984126984126984d0) * (t * t)))) - 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = Math.abs(((eh * eh) / Math.abs(eh)));
} else if (ew <= 4e+110) {
tmp = Math.abs((eh / (ew * Math.sqrt((1.0 / (ew * ew))))));
} else {
tmp = Math.abs((ew * (t * (1.0 + ((t * t) * (((t * t) * (0.008333333333333333 + (-0.0001984126984126984 * (t * t)))) - 0.16666666666666666))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 7.5e-155: tmp = math.fabs(((eh * eh) / math.fabs(eh))) elif ew <= 4e+110: tmp = math.fabs((eh / (ew * math.sqrt((1.0 / (ew * ew)))))) else: tmp = math.fabs((ew * (t * (1.0 + ((t * t) * (((t * t) * (0.008333333333333333 + (-0.0001984126984126984 * (t * t)))) - 0.16666666666666666)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 7.5e-155) tmp = abs(Float64(Float64(eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs(Float64(eh / Float64(ew * sqrt(Float64(1.0 / Float64(ew * ew)))))); else tmp = abs(Float64(ew * Float64(t * Float64(1.0 + Float64(Float64(t * t) * Float64(Float64(Float64(t * t) * Float64(0.008333333333333333 + Float64(-0.0001984126984126984 * Float64(t * t)))) - 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 7.5e-155) tmp = abs(((eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs((eh / (ew * sqrt((1.0 / (ew * ew)))))); else tmp = abs((ew * (t * (1.0 + ((t * t) * (((t * t) * (0.008333333333333333 + (-0.0001984126984126984 * (t * t)))) - 0.16666666666666666)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 7.5e-155], N[Abs[N[(N[(eh * eh), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+110], N[Abs[N[(eh / N[(ew * N[Sqrt[N[(1.0 / N[(ew * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(t * N[(1.0 + N[(N[(t * t), $MachinePrecision] * N[(N[(N[(t * t), $MachinePrecision] * N[(0.008333333333333333 + N[(-0.0001984126984126984 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 7.5 \cdot 10^{-155}:\\
\;\;\;\;\left|\frac{eh \cdot eh}{\left|eh\right|}\right|\\
\mathbf{elif}\;ew \leq 4 \cdot 10^{+110}:\\
\;\;\;\;\left|\frac{eh}{ew \cdot \sqrt{\frac{1}{ew \cdot ew}}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(t \cdot \left(1 + \left(t \cdot t\right) \cdot \left(\left(t \cdot t\right) \cdot \left(0.008333333333333333 + -0.0001984126984126984 \cdot \left(t \cdot t\right)\right) - 0.16666666666666666\right)\right)\right)\right|\\
\end{array}
\end{array}
if ew < 7.5000000000000006e-155Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in ew around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6421.5
Applied rewrites21.5%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-sqrt-squareN/A
lower-fabs.f6424.2
Applied rewrites24.2%
if 7.5000000000000006e-155 < ew < 4.0000000000000001e110Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6424.1
Applied rewrites24.1%
if 4.0000000000000001e110 < ew Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6418.6
Applied rewrites18.6%
(FPCore (eh ew t)
:precision binary64
(if (<= ew 7.5e-155)
(fabs (/ (* eh eh) (fabs eh)))
(if (<= ew 4e+110)
(fabs (/ eh (* ew (sqrt (/ 1.0 (* ew ew))))))
(fabs
(*
t
(+
ew
(*
(* t t)
(fma
-0.16666666666666666
ew
(* 0.008333333333333333 (* ew (* t t)))))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = fabs(((eh * eh) / fabs(eh)));
} else if (ew <= 4e+110) {
tmp = fabs((eh / (ew * sqrt((1.0 / (ew * ew))))));
} else {
tmp = fabs((t * (ew + ((t * t) * fma(-0.16666666666666666, ew, (0.008333333333333333 * (ew * (t * t))))))));
}
return tmp;
}
function code(eh, ew, t) tmp = 0.0 if (ew <= 7.5e-155) tmp = abs(Float64(Float64(eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs(Float64(eh / Float64(ew * sqrt(Float64(1.0 / Float64(ew * ew)))))); else tmp = abs(Float64(t * Float64(ew + Float64(Float64(t * t) * fma(-0.16666666666666666, ew, Float64(0.008333333333333333 * Float64(ew * Float64(t * t)))))))); end return tmp end
code[eh_, ew_, t_] := If[LessEqual[ew, 7.5e-155], N[Abs[N[(N[(eh * eh), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+110], N[Abs[N[(eh / N[(ew * N[Sqrt[N[(1.0 / N[(ew * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t * N[(ew + N[(N[(t * t), $MachinePrecision] * N[(-0.16666666666666666 * ew + N[(0.008333333333333333 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 7.5 \cdot 10^{-155}:\\
\;\;\;\;\left|\frac{eh \cdot eh}{\left|eh\right|}\right|\\
\mathbf{elif}\;ew \leq 4 \cdot 10^{+110}:\\
\;\;\;\;\left|\frac{eh}{ew \cdot \sqrt{\frac{1}{ew \cdot ew}}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t \cdot \left(ew + \left(t \cdot t\right) \cdot \mathsf{fma}\left(-0.16666666666666666, ew, 0.008333333333333333 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right)\right)\right|\\
\end{array}
\end{array}
if ew < 7.5000000000000006e-155Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in ew around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6421.5
Applied rewrites21.5%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-sqrt-squareN/A
lower-fabs.f6424.2
Applied rewrites24.2%
if 7.5000000000000006e-155 < ew < 4.0000000000000001e110Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6424.1
Applied rewrites24.1%
if 4.0000000000000001e110 < ew Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6418.6
Applied rewrites18.6%
(FPCore (eh ew t)
:precision binary64
(if (<= ew 7.5e-155)
(fabs (/ (* eh eh) (fabs eh)))
(if (<= ew 4e+110)
(fabs (/ eh (* ew (sqrt (/ 1.0 (* ew ew))))))
(fabs
(*
ew
(*
t
(+
1.0
(*
(* t t)
(- (* 0.008333333333333333 (* t t)) 0.16666666666666666)))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = fabs(((eh * eh) / fabs(eh)));
} else if (ew <= 4e+110) {
tmp = fabs((eh / (ew * sqrt((1.0 / (ew * ew))))));
} else {
tmp = fabs((ew * (t * (1.0 + ((t * t) * ((0.008333333333333333 * (t * t)) - 0.16666666666666666))))));
}
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) :: tmp
if (ew <= 7.5d-155) then
tmp = abs(((eh * eh) / abs(eh)))
else if (ew <= 4d+110) then
tmp = abs((eh / (ew * sqrt((1.0d0 / (ew * ew))))))
else
tmp = abs((ew * (t * (1.0d0 + ((t * t) * ((0.008333333333333333d0 * (t * t)) - 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = Math.abs(((eh * eh) / Math.abs(eh)));
} else if (ew <= 4e+110) {
tmp = Math.abs((eh / (ew * Math.sqrt((1.0 / (ew * ew))))));
} else {
tmp = Math.abs((ew * (t * (1.0 + ((t * t) * ((0.008333333333333333 * (t * t)) - 0.16666666666666666))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 7.5e-155: tmp = math.fabs(((eh * eh) / math.fabs(eh))) elif ew <= 4e+110: tmp = math.fabs((eh / (ew * math.sqrt((1.0 / (ew * ew)))))) else: tmp = math.fabs((ew * (t * (1.0 + ((t * t) * ((0.008333333333333333 * (t * t)) - 0.16666666666666666)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 7.5e-155) tmp = abs(Float64(Float64(eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs(Float64(eh / Float64(ew * sqrt(Float64(1.0 / Float64(ew * ew)))))); else tmp = abs(Float64(ew * Float64(t * Float64(1.0 + Float64(Float64(t * t) * Float64(Float64(0.008333333333333333 * Float64(t * t)) - 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 7.5e-155) tmp = abs(((eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs((eh / (ew * sqrt((1.0 / (ew * ew)))))); else tmp = abs((ew * (t * (1.0 + ((t * t) * ((0.008333333333333333 * (t * t)) - 0.16666666666666666)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 7.5e-155], N[Abs[N[(N[(eh * eh), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+110], N[Abs[N[(eh / N[(ew * N[Sqrt[N[(1.0 / N[(ew * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(t * N[(1.0 + N[(N[(t * t), $MachinePrecision] * N[(N[(0.008333333333333333 * N[(t * t), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 7.5 \cdot 10^{-155}:\\
\;\;\;\;\left|\frac{eh \cdot eh}{\left|eh\right|}\right|\\
\mathbf{elif}\;ew \leq 4 \cdot 10^{+110}:\\
\;\;\;\;\left|\frac{eh}{ew \cdot \sqrt{\frac{1}{ew \cdot ew}}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(t \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.008333333333333333 \cdot \left(t \cdot t\right) - 0.16666666666666666\right)\right)\right)\right|\\
\end{array}
\end{array}
if ew < 7.5000000000000006e-155Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in ew around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6421.5
Applied rewrites21.5%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-sqrt-squareN/A
lower-fabs.f6424.2
Applied rewrites24.2%
if 7.5000000000000006e-155 < ew < 4.0000000000000001e110Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6424.1
Applied rewrites24.1%
if 4.0000000000000001e110 < ew Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6418.6
Applied rewrites18.6%
(FPCore (eh ew t)
:precision binary64
(if (<= ew 7.5e-155)
(fabs (/ (* eh eh) (fabs eh)))
(if (<= ew 4e+110)
(fabs (/ eh (* ew (sqrt (/ 1.0 (* ew ew))))))
(fabs (* ew (* t (+ 1.0 (* -0.16666666666666666 (* t t)))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = fabs(((eh * eh) / fabs(eh)));
} else if (ew <= 4e+110) {
tmp = fabs((eh / (ew * sqrt((1.0 / (ew * ew))))));
} else {
tmp = fabs((ew * (t * (1.0 + (-0.16666666666666666 * (t * t))))));
}
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) :: tmp
if (ew <= 7.5d-155) then
tmp = abs(((eh * eh) / abs(eh)))
else if (ew <= 4d+110) then
tmp = abs((eh / (ew * sqrt((1.0d0 / (ew * ew))))))
else
tmp = abs((ew * (t * (1.0d0 + ((-0.16666666666666666d0) * (t * t))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = Math.abs(((eh * eh) / Math.abs(eh)));
} else if (ew <= 4e+110) {
tmp = Math.abs((eh / (ew * Math.sqrt((1.0 / (ew * ew))))));
} else {
tmp = Math.abs((ew * (t * (1.0 + (-0.16666666666666666 * (t * t))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 7.5e-155: tmp = math.fabs(((eh * eh) / math.fabs(eh))) elif ew <= 4e+110: tmp = math.fabs((eh / (ew * math.sqrt((1.0 / (ew * ew)))))) else: tmp = math.fabs((ew * (t * (1.0 + (-0.16666666666666666 * (t * t)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 7.5e-155) tmp = abs(Float64(Float64(eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs(Float64(eh / Float64(ew * sqrt(Float64(1.0 / Float64(ew * ew)))))); else tmp = abs(Float64(ew * Float64(t * Float64(1.0 + Float64(-0.16666666666666666 * Float64(t * t)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 7.5e-155) tmp = abs(((eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs((eh / (ew * sqrt((1.0 / (ew * ew)))))); else tmp = abs((ew * (t * (1.0 + (-0.16666666666666666 * (t * t)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 7.5e-155], N[Abs[N[(N[(eh * eh), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+110], N[Abs[N[(eh / N[(ew * N[Sqrt[N[(1.0 / N[(ew * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * N[(t * N[(1.0 + N[(-0.16666666666666666 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 7.5 \cdot 10^{-155}:\\
\;\;\;\;\left|\frac{eh \cdot eh}{\left|eh\right|}\right|\\
\mathbf{elif}\;ew \leq 4 \cdot 10^{+110}:\\
\;\;\;\;\left|\frac{eh}{ew \cdot \sqrt{\frac{1}{ew \cdot ew}}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot \left(t \cdot \left(1 + -0.16666666666666666 \cdot \left(t \cdot t\right)\right)\right)\right|\\
\end{array}
\end{array}
if ew < 7.5000000000000006e-155Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in ew around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6421.5
Applied rewrites21.5%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-sqrt-squareN/A
lower-fabs.f6424.2
Applied rewrites24.2%
if 7.5000000000000006e-155 < ew < 4.0000000000000001e110Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6424.1
Applied rewrites24.1%
if 4.0000000000000001e110 < ew Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6418.6
Applied rewrites18.6%
(FPCore (eh ew t)
:precision binary64
(if (<= ew 7.5e-155)
(fabs (/ (* eh eh) (fabs eh)))
(if (<= ew 4e+110)
(fabs (/ eh (* ew (sqrt (/ 1.0 (* ew ew))))))
(fabs (* t (+ ew (* -0.16666666666666666 (* ew (* t t)))))))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = fabs(((eh * eh) / fabs(eh)));
} else if (ew <= 4e+110) {
tmp = fabs((eh / (ew * sqrt((1.0 / (ew * ew))))));
} else {
tmp = fabs((t * (ew + (-0.16666666666666666 * (ew * (t * t))))));
}
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) :: tmp
if (ew <= 7.5d-155) then
tmp = abs(((eh * eh) / abs(eh)))
else if (ew <= 4d+110) then
tmp = abs((eh / (ew * sqrt((1.0d0 / (ew * ew))))))
else
tmp = abs((t * (ew + ((-0.16666666666666666d0) * (ew * (t * t))))))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = Math.abs(((eh * eh) / Math.abs(eh)));
} else if (ew <= 4e+110) {
tmp = Math.abs((eh / (ew * Math.sqrt((1.0 / (ew * ew))))));
} else {
tmp = Math.abs((t * (ew + (-0.16666666666666666 * (ew * (t * t))))));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 7.5e-155: tmp = math.fabs(((eh * eh) / math.fabs(eh))) elif ew <= 4e+110: tmp = math.fabs((eh / (ew * math.sqrt((1.0 / (ew * ew)))))) else: tmp = math.fabs((t * (ew + (-0.16666666666666666 * (ew * (t * t)))))) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 7.5e-155) tmp = abs(Float64(Float64(eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs(Float64(eh / Float64(ew * sqrt(Float64(1.0 / Float64(ew * ew)))))); else tmp = abs(Float64(t * Float64(ew + Float64(-0.16666666666666666 * Float64(ew * Float64(t * t)))))); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 7.5e-155) tmp = abs(((eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs((eh / (ew * sqrt((1.0 / (ew * ew)))))); else tmp = abs((t * (ew + (-0.16666666666666666 * (ew * (t * t)))))); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 7.5e-155], N[Abs[N[(N[(eh * eh), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+110], N[Abs[N[(eh / N[(ew * N[Sqrt[N[(1.0 / N[(ew * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t * N[(ew + N[(-0.16666666666666666 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 7.5 \cdot 10^{-155}:\\
\;\;\;\;\left|\frac{eh \cdot eh}{\left|eh\right|}\right|\\
\mathbf{elif}\;ew \leq 4 \cdot 10^{+110}:\\
\;\;\;\;\left|\frac{eh}{ew \cdot \sqrt{\frac{1}{ew \cdot ew}}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t \cdot \left(ew + -0.16666666666666666 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right)\right|\\
\end{array}
\end{array}
if ew < 7.5000000000000006e-155Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in ew around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6421.5
Applied rewrites21.5%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-sqrt-squareN/A
lower-fabs.f6424.2
Applied rewrites24.2%
if 7.5000000000000006e-155 < ew < 4.0000000000000001e110Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6424.1
Applied rewrites24.1%
if 4.0000000000000001e110 < ew Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in t around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6418.7
Applied rewrites18.7%
(FPCore (eh ew t)
:precision binary64
(if (<= ew 7.5e-155)
(fabs (/ (* eh eh) (fabs eh)))
(if (<= ew 4e+110)
(fabs (/ eh (* ew (sqrt (/ 1.0 (* ew ew))))))
(fabs (* ew t)))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = fabs(((eh * eh) / fabs(eh)));
} else if (ew <= 4e+110) {
tmp = fabs((eh / (ew * sqrt((1.0 / (ew * ew))))));
} else {
tmp = fabs((ew * t));
}
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) :: tmp
if (ew <= 7.5d-155) then
tmp = abs(((eh * eh) / abs(eh)))
else if (ew <= 4d+110) then
tmp = abs((eh / (ew * sqrt((1.0d0 / (ew * ew))))))
else
tmp = abs((ew * t))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 7.5e-155) {
tmp = Math.abs(((eh * eh) / Math.abs(eh)));
} else if (ew <= 4e+110) {
tmp = Math.abs((eh / (ew * Math.sqrt((1.0 / (ew * ew))))));
} else {
tmp = Math.abs((ew * t));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 7.5e-155: tmp = math.fabs(((eh * eh) / math.fabs(eh))) elif ew <= 4e+110: tmp = math.fabs((eh / (ew * math.sqrt((1.0 / (ew * ew)))))) else: tmp = math.fabs((ew * t)) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 7.5e-155) tmp = abs(Float64(Float64(eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs(Float64(eh / Float64(ew * sqrt(Float64(1.0 / Float64(ew * ew)))))); else tmp = abs(Float64(ew * t)); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 7.5e-155) tmp = abs(((eh * eh) / abs(eh))); elseif (ew <= 4e+110) tmp = abs((eh / (ew * sqrt((1.0 / (ew * ew)))))); else tmp = abs((ew * t)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 7.5e-155], N[Abs[N[(N[(eh * eh), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 4e+110], N[Abs[N[(eh / N[(ew * N[Sqrt[N[(1.0 / N[(ew * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 7.5 \cdot 10^{-155}:\\
\;\;\;\;\left|\frac{eh \cdot eh}{\left|eh\right|}\right|\\
\mathbf{elif}\;ew \leq 4 \cdot 10^{+110}:\\
\;\;\;\;\left|\frac{eh}{ew \cdot \sqrt{\frac{1}{ew \cdot ew}}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot t\right|\\
\end{array}
\end{array}
if ew < 7.5000000000000006e-155Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in ew around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6421.5
Applied rewrites21.5%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-sqrt-squareN/A
lower-fabs.f6424.2
Applied rewrites24.2%
if 7.5000000000000006e-155 < ew < 4.0000000000000001e110Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in eh around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6424.1
Applied rewrites24.1%
if 4.0000000000000001e110 < ew Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in t around 0
lower-*.f6418.9
Applied rewrites18.9%
(FPCore (eh ew t) :precision binary64 (if (<= ew 3.9e+46) (fabs (/ (* eh eh) (fabs eh))) (fabs (* ew t))))
double code(double eh, double ew, double t) {
double tmp;
if (ew <= 3.9e+46) {
tmp = fabs(((eh * eh) / fabs(eh)));
} else {
tmp = fabs((ew * t));
}
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) :: tmp
if (ew <= 3.9d+46) then
tmp = abs(((eh * eh) / abs(eh)))
else
tmp = abs((ew * t))
end if
code = tmp
end function
public static double code(double eh, double ew, double t) {
double tmp;
if (ew <= 3.9e+46) {
tmp = Math.abs(((eh * eh) / Math.abs(eh)));
} else {
tmp = Math.abs((ew * t));
}
return tmp;
}
def code(eh, ew, t): tmp = 0 if ew <= 3.9e+46: tmp = math.fabs(((eh * eh) / math.fabs(eh))) else: tmp = math.fabs((ew * t)) return tmp
function code(eh, ew, t) tmp = 0.0 if (ew <= 3.9e+46) tmp = abs(Float64(Float64(eh * eh) / abs(eh))); else tmp = abs(Float64(ew * t)); end return tmp end
function tmp_2 = code(eh, ew, t) tmp = 0.0; if (ew <= 3.9e+46) tmp = abs(((eh * eh) / abs(eh))); else tmp = abs((ew * t)); end tmp_2 = tmp; end
code[eh_, ew_, t_] := If[LessEqual[ew, 3.9e+46], N[Abs[N[(N[(eh * eh), $MachinePrecision] / N[Abs[eh], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ew \leq 3.9 \cdot 10^{+46}:\\
\;\;\;\;\left|\frac{eh \cdot eh}{\left|eh\right|}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|ew \cdot t\right|\\
\end{array}
\end{array}
if ew < 3.89999999999999995e46Initial program 99.8%
lift-sin.f64N/A
lift-atan.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
sin-atanN/A
lower-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f64N/A
lower-sqrt.f64N/A
lower-+.f64N/A
pow2N/A
lower-pow.f64N/A
Applied rewrites61.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6411.3
Applied rewrites11.3%
Taylor expanded in ew around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6421.5
Applied rewrites21.5%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-sqrt-squareN/A
lower-fabs.f6424.2
Applied rewrites24.2%
if 3.89999999999999995e46 < ew Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in t around 0
lower-*.f6418.9
Applied rewrites18.9%
(FPCore (eh ew t) :precision binary64 (fabs (* ew t)))
double code(double eh, double ew, double t) {
return fabs((ew * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(eh, ew, t)
use fmin_fmax_functions
real(8), intent (in) :: eh
real(8), intent (in) :: ew
real(8), intent (in) :: t
code = abs((ew * t))
end function
public static double code(double eh, double ew, double t) {
return Math.abs((ew * t));
}
def code(eh, ew, t): return math.fabs((ew * t))
function code(eh, ew, t) return abs(Float64(ew * t)) end
function tmp = code(eh, ew, t) tmp = abs((ew * t)); end
code[eh_, ew_, t_] := N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|ew \cdot t\right|
\end{array}
Initial program 99.8%
Taylor expanded in eh around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in eh around 0
lift-sin.f64N/A
lift-*.f6442.7
Applied rewrites42.7%
Taylor expanded in t around 0
lower-*.f6418.9
Applied rewrites18.9%
herbie shell --seed 2025142
(FPCore (eh ew t)
:name "Example from Robby"
:precision binary64
(fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))