
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y (fma y (+ a y) b) c))
(t_2 (+ x (/ (- z (* a x)) y)))
(t_3 (fma (fma (fma (+ a y) y b) y c) y i)))
(if (<= y -7e+54)
t_2
(if (<= y 1.45e+28)
(fma
y
(/ (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) t_3)
(/ t t_3))
(if (<= y 1e+99)
(*
(- x)
(fma
-1.0
(/
(+
(fma y (/ (fma y z 27464.7644705) t_1) (/ t (* y t_1)))
(/ 230661.510616 t_1))
x)
(/ (- (pow y 3.0)) t_1)))
t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, fma(y, (a + y), b), c);
double t_2 = x + ((z - (a * x)) / y);
double t_3 = fma(fma(fma((a + y), y, b), y, c), y, i);
double tmp;
if (y <= -7e+54) {
tmp = t_2;
} else if (y <= 1.45e+28) {
tmp = fma(y, (fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_3), (t / t_3));
} else if (y <= 1e+99) {
tmp = -x * fma(-1.0, ((fma(y, (fma(y, z, 27464.7644705) / t_1), (t / (y * t_1))) + (230661.510616 / t_1)) / x), (-pow(y, 3.0) / t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, fma(y, Float64(a + y), b), c) t_2 = Float64(x + Float64(Float64(z - Float64(a * x)) / y)) t_3 = fma(fma(fma(Float64(a + y), y, b), y, c), y, i) tmp = 0.0 if (y <= -7e+54) tmp = t_2; elseif (y <= 1.45e+28) tmp = fma(y, Float64(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_3), Float64(t / t_3)); elseif (y <= 1e+99) tmp = Float64(Float64(-x) * fma(-1.0, Float64(Float64(fma(y, Float64(fma(y, z, 27464.7644705) / t_1), Float64(t / Float64(y * t_1))) + Float64(230661.510616 / t_1)) / x), Float64(Float64(-(y ^ 3.0)) / t_1))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * N[(y * N[(a + y), $MachinePrecision] + b), $MachinePrecision] + c), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]}, If[LessEqual[y, -7e+54], t$95$2, If[LessEqual[y, 1.45e+28], N[(y * N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(t / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+99], N[((-x) * N[(-1.0 * N[(N[(N[(y * N[(N[(y * z + 27464.7644705), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(230661.510616 / t$95$1), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[((-N[Power[y, 3.0], $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \mathsf{fma}\left(y, a + y, b\right), c\right)\\
t_2 := x + \frac{z - a \cdot x}{y}\\
t_3 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)\\
\mathbf{if}\;y \leq -7 \cdot 10^{+54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)}{t\_3}, \frac{t}{t\_3}\right)\\
\mathbf{elif}\;y \leq 10^{+99}:\\
\;\;\;\;\left(-x\right) \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(y, z, 27464.7644705\right)}{t\_1}, \frac{t}{y \cdot t\_1}\right) + \frac{230661.510616}{t\_1}}{x}, \frac{-{y}^{3}}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -7.0000000000000002e54 or 9.9999999999999997e98 < y Initial program 1.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites2.6%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6472.3
Applied rewrites72.3%
if -7.0000000000000002e54 < y < 1.4500000000000001e28Initial program 96.2%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites97.0%
if 1.4500000000000001e28 < y < 9.9999999999999997e98Initial program 26.4%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites33.4%
Taylor expanded in x around -inf
Applied rewrites75.4%
Final simplification86.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (fma (fma (+ a y) y b) y c) y i)))
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
INFINITY)
(fma
y
(/ (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) t_1)
(/ t t_1))
(+ x (/ (- z (* a x)) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(fma(fma((a + y), y, b), y, c), y, i);
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= ((double) INFINITY)) {
tmp = fma(y, (fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_1), (t / t_1));
} else {
tmp = x + ((z - (a * x)) / y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(fma(fma(Float64(a + y), y, b), y, c), y, i) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) <= Inf) tmp = fma(y, Float64(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_1), Float64(t / t_1)); else tmp = Float64(x + Float64(Float64(z - Float64(a * x)) / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], Infinity], N[(y * N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)\\
\mathbf{if}\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)}{t\_1}, \frac{t}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - a \cdot x}{y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < +inf.0Initial program 90.7%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites92.5%
if +inf.0 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) Initial program 0.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites0.3%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.5%
Final simplification83.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))))
(if (<= t_1 INFINITY) t_1 (+ x (/ (- z (* a x)) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x + ((z - (a * x)) / y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x + ((z - (a * x)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x + ((z - (a * x)) / y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x + Float64(Float64(z - Float64(a * x)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x + ((z - (a * x)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - a \cdot x}{y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < +inf.0Initial program 90.7%
if +inf.0 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) Initial program 0.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites0.3%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.5%
Final simplification81.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ (- z (* a x)) y))) (t_2 (fma (fma (+ a y) y b) y c)))
(if (<= y -7e+54)
t_1
(if (<= y -4.4e-7)
(/
(/ (fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t) y)
t_2)
(if (<= y 8.8e+41)
(/
(fma (fma (fma z y 27464.7644705) y 230661.510616) y t)
(fma t_2 y i))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x + ((z - (a * x)) / y);
double t_2 = fma(fma((a + y), y, b), y, c);
double tmp;
if (y <= -7e+54) {
tmp = t_1;
} else if (y <= -4.4e-7) {
tmp = (fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / y) / t_2;
} else if (y <= 8.8e+41) {
tmp = fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(t_2, y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(Float64(z - Float64(a * x)) / y)) t_2 = fma(fma(Float64(a + y), y, b), y, c) tmp = 0.0 if (y <= -7e+54) tmp = t_1; elseif (y <= -4.4e-7) tmp = Float64(Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / y) / t_2); elseif (y <= 8.8e+41) tmp = Float64(fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(t_2, y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]}, If[LessEqual[y, -7e+54], t$95$1, If[LessEqual[y, -4.4e-7], N[(N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / y), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[y, 8.8e+41], N[(N[(N[(N[(z * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(t$95$2 * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z - a \cdot x}{y}\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)\\
\mathbf{if}\;y \leq -7 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{y}}{t\_2}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(t\_2, y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.0000000000000002e54 or 8.79999999999999959e41 < y Initial program 5.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites7.0%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6466.4
Applied rewrites66.4%
if -7.0000000000000002e54 < y < -4.4000000000000002e-7Initial program 71.2%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites84.5%
if -4.4000000000000002e-7 < y < 8.79999999999999959e41Initial program 96.1%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites93.4%
Final simplification81.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(/
(fma y (fma y (fma x y z) 27464.7644705) 230661.510616)
(fma y (fma y (+ a y) b) c)))
(t_2 (+ x (/ (- z (* a x)) y))))
(if (<= y -7e+54)
t_2
(if (<= y -1.5e-27)
t_1
(if (<= y 0.0007)
(/ (fma 230661.510616 y t) (fma (fma (fma (+ a y) y b) y c) y i))
(if (<= y 1.65e+87) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, fma(y, fma(x, y, z), 27464.7644705), 230661.510616) / fma(y, fma(y, (a + y), b), c);
double t_2 = x + ((z - (a * x)) / y);
double tmp;
if (y <= -7e+54) {
tmp = t_2;
} else if (y <= -1.5e-27) {
tmp = t_1;
} else if (y <= 0.0007) {
tmp = fma(230661.510616, y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else if (y <= 1.65e+87) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(y, fma(y, fma(x, y, z), 27464.7644705), 230661.510616) / fma(y, fma(y, Float64(a + y), b), c)) t_2 = Float64(x + Float64(Float64(z - Float64(a * x)) / y)) tmp = 0.0 if (y <= -7e+54) tmp = t_2; elseif (y <= -1.5e-27) tmp = t_1; elseif (y <= 0.0007) tmp = Float64(fma(230661.510616, y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); elseif (y <= 1.65e+87) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * N[(y * N[(x * y + z), $MachinePrecision] + 27464.7644705), $MachinePrecision] + 230661.510616), $MachinePrecision] / N[(y * N[(y * N[(a + y), $MachinePrecision] + b), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+54], t$95$2, If[LessEqual[y, -1.5e-27], t$95$1, If[LessEqual[y, 0.0007], N[(N[(230661.510616 * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+87], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, a + y, b\right), c\right)}\\
t_2 := x + \frac{z - a \cdot x}{y}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.0007:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -7.0000000000000002e54 or 1.6500000000000001e87 < y Initial program 1.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites2.6%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6472.3
Applied rewrites72.3%
if -7.0000000000000002e54 < y < -1.5000000000000001e-27 or 6.99999999999999993e-4 < y < 1.6500000000000001e87Initial program 57.9%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites63.8%
Taylor expanded in t around 0
Applied rewrites56.8%
if -1.5000000000000001e-27 < y < 6.99999999999999993e-4Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites97.6%
Taylor expanded in y around 0
Applied rewrites91.3%
Final simplification78.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= y -4e+50) (not (<= y 8.8e+41)))
(+ x (/ (- z (* a x)) y))
(/
(fma (fma (fma z y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma (+ a y) y b) y c) y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -4e+50) || !(y <= 8.8e+41)) {
tmp = x + ((z - (a * x)) / y);
} else {
tmp = fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -4e+50) || !(y <= 8.8e+41)) tmp = Float64(x + Float64(Float64(z - Float64(a * x)) / y)); else tmp = Float64(fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -4e+50], N[Not[LessEqual[y, 8.8e+41]], $MachinePrecision]], N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+50} \lor \neg \left(y \leq 8.8 \cdot 10^{+41}\right):\\
\;\;\;\;x + \frac{z - a \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\end{array}
\end{array}
if y < -4.0000000000000003e50 or 8.79999999999999959e41 < y Initial program 5.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites7.0%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6466.4
Applied rewrites66.4%
if -4.0000000000000003e50 < y < 8.79999999999999959e41Initial program 93.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites88.6%
Final simplification79.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -9.6e+19) (not (<= y 5.2e+41))) (+ x (/ (- z (* a x)) y)) (/ (fma 230661.510616 y t) (fma (fma (fma (+ a y) y b) y c) y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -9.6e+19) || !(y <= 5.2e+41)) {
tmp = x + ((z - (a * x)) / y);
} else {
tmp = fma(230661.510616, y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -9.6e+19) || !(y <= 5.2e+41)) tmp = Float64(x + Float64(Float64(z - Float64(a * x)) / y)); else tmp = Float64(fma(230661.510616, y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -9.6e+19], N[Not[LessEqual[y, 5.2e+41]], $MachinePrecision]], N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(230661.510616 * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{+19} \lor \neg \left(y \leq 5.2 \cdot 10^{+41}\right):\\
\;\;\;\;x + \frac{z - a \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\end{array}
\end{array}
if y < -9.6e19 or 5.2000000000000001e41 < y Initial program 8.2%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites10.2%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6464.9
Applied rewrites64.9%
if -9.6e19 < y < 5.2000000000000001e41Initial program 95.5%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites90.9%
Taylor expanded in y around 0
Applied rewrites82.4%
Final simplification74.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -9.6e+19) (not (<= y 5.2e+41))) (+ x (/ (- z (* a x)) y)) (/ t (fma (fma (fma (+ a y) y b) y c) y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -9.6e+19) || !(y <= 5.2e+41)) {
tmp = x + ((z - (a * x)) / y);
} else {
tmp = t / fma(fma(fma((a + y), y, b), y, c), y, i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -9.6e+19) || !(y <= 5.2e+41)) tmp = Float64(x + Float64(Float64(z - Float64(a * x)) / y)); else tmp = Float64(t / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -9.6e+19], N[Not[LessEqual[y, 5.2e+41]], $MachinePrecision]], N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{+19} \lor \neg \left(y \leq 5.2 \cdot 10^{+41}\right):\\
\;\;\;\;x + \frac{z - a \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\end{array}
\end{array}
if y < -9.6e19 or 5.2000000000000001e41 < y Initial program 8.2%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites10.2%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6464.9
Applied rewrites64.9%
if -9.6e19 < y < 5.2000000000000001e41Initial program 95.5%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f6469.5
Applied rewrites69.5%
Final simplification67.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -2.5e-7) (not (<= y 1.6e-16))) (+ x (/ (- z (* a x)) y)) (/ (fma 230661.510616 y t) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -2.5e-7) || !(y <= 1.6e-16)) {
tmp = x + ((z - (a * x)) / y);
} else {
tmp = fma(230661.510616, y, t) / i;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -2.5e-7) || !(y <= 1.6e-16)) tmp = Float64(x + Float64(Float64(z - Float64(a * x)) / y)); else tmp = Float64(fma(230661.510616, y, t) / i); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -2.5e-7], N[Not[LessEqual[y, 1.6e-16]], $MachinePrecision]], N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(230661.510616 * y + t), $MachinePrecision] / i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-7} \lor \neg \left(y \leq 1.6 \cdot 10^{-16}\right):\\
\;\;\;\;x + \frac{z - a \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{i}\\
\end{array}
\end{array}
if y < -2.49999999999999989e-7 or 1.60000000000000011e-16 < y Initial program 17.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites19.8%
Taylor expanded in y around inf
associate--l+N/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
if -2.49999999999999989e-7 < y < 1.60000000000000011e-16Initial program 99.7%
Taylor expanded in i around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6460.9
Applied rewrites60.9%
Taylor expanded in y around 0
Applied rewrites59.5%
Final simplification58.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (/ x t) t)))
(if (<= y -0.000235)
t_1
(if (<= y 200000.0)
(/ (fma 230661.510616 y t) i)
(if (<= y 4.9e+240) (* (/ y a) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x / t) * t;
double tmp;
if (y <= -0.000235) {
tmp = t_1;
} else if (y <= 200000.0) {
tmp = fma(230661.510616, y, t) / i;
} else if (y <= 4.9e+240) {
tmp = (y / a) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x / t) * t) tmp = 0.0 if (y <= -0.000235) tmp = t_1; elseif (y <= 200000.0) tmp = Float64(fma(230661.510616, y, t) / i); elseif (y <= 4.9e+240) tmp = Float64(Float64(y / a) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -0.000235], t$95$1, If[LessEqual[y, 200000.0], N[(N[(230661.510616 * y + t), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[y, 4.9e+240], N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t} \cdot t\\
\mathbf{if}\;y \leq -0.000235:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 200000:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{i}\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+240}:\\
\;\;\;\;\frac{y}{a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.34999999999999993e-4 or 4.9e240 < y Initial program 13.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites13.5%
Taylor expanded in y around inf
Applied rewrites39.2%
if -2.34999999999999993e-4 < y < 2e5Initial program 99.7%
Taylor expanded in i around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6459.7
Applied rewrites59.7%
Taylor expanded in y around 0
Applied rewrites57.6%
if 2e5 < y < 4.9e240Initial program 15.9%
Taylor expanded in a around inf
associate-/r*N/A
lower-/.f64N/A
Applied rewrites5.4%
Taylor expanded in x around inf
Applied rewrites18.6%
Applied rewrites29.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (/ x t) t)))
(if (<= y -0.000245)
t_1
(if (<= y 200000.0) (/ t i) (if (<= y 4.9e+240) (* (/ y a) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x / t) * t;
double tmp;
if (y <= -0.000245) {
tmp = t_1;
} else if (y <= 200000.0) {
tmp = t / i;
} else if (y <= 4.9e+240) {
tmp = (y / a) * x;
} 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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x / t) * t
if (y <= (-0.000245d0)) then
tmp = t_1
else if (y <= 200000.0d0) then
tmp = t / i
else if (y <= 4.9d+240) then
tmp = (y / a) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x / t) * t;
double tmp;
if (y <= -0.000245) {
tmp = t_1;
} else if (y <= 200000.0) {
tmp = t / i;
} else if (y <= 4.9e+240) {
tmp = (y / a) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x / t) * t tmp = 0 if y <= -0.000245: tmp = t_1 elif y <= 200000.0: tmp = t / i elif y <= 4.9e+240: tmp = (y / a) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x / t) * t) tmp = 0.0 if (y <= -0.000245) tmp = t_1; elseif (y <= 200000.0) tmp = Float64(t / i); elseif (y <= 4.9e+240) tmp = Float64(Float64(y / a) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x / t) * t; tmp = 0.0; if (y <= -0.000245) tmp = t_1; elseif (y <= 200000.0) tmp = t / i; elseif (y <= 4.9e+240) tmp = (y / a) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -0.000245], t$95$1, If[LessEqual[y, 200000.0], N[(t / i), $MachinePrecision], If[LessEqual[y, 4.9e+240], N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t} \cdot t\\
\mathbf{if}\;y \leq -0.000245:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 200000:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+240}:\\
\;\;\;\;\frac{y}{a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4499999999999999e-4 or 4.9e240 < y Initial program 13.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites13.5%
Taylor expanded in y around inf
Applied rewrites39.2%
if -2.4499999999999999e-4 < y < 2e5Initial program 99.7%
Taylor expanded in y around 0
lower-/.f6449.8
Applied rewrites49.8%
if 2e5 < y < 4.9e240Initial program 15.9%
Taylor expanded in a around inf
associate-/r*N/A
lower-/.f64N/A
Applied rewrites5.4%
Taylor expanded in x around inf
Applied rewrites18.6%
Applied rewrites29.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -6.6e-16) (/ z y) (if (<= y 200000.0) (/ t i) (* (/ y a) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -6.6e-16) {
tmp = z / y;
} else if (y <= 200000.0) {
tmp = t / i;
} else {
tmp = (y / a) * x;
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (y <= (-6.6d-16)) then
tmp = z / y
else if (y <= 200000.0d0) then
tmp = t / i
else
tmp = (y / a) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -6.6e-16) {
tmp = z / y;
} else if (y <= 200000.0) {
tmp = t / i;
} else {
tmp = (y / a) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -6.6e-16: tmp = z / y elif y <= 200000.0: tmp = t / i else: tmp = (y / a) * x return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -6.6e-16) tmp = Float64(z / y); elseif (y <= 200000.0) tmp = Float64(t / i); else tmp = Float64(Float64(y / a) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -6.6e-16) tmp = z / y; elseif (y <= 200000.0) tmp = t / i; else tmp = (y / a) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -6.6e-16], N[(z / y), $MachinePrecision], If[LessEqual[y, 200000.0], N[(t / i), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{-16}:\\
\;\;\;\;\frac{z}{y}\\
\mathbf{elif}\;y \leq 200000:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot x\\
\end{array}
\end{array}
if y < -6.59999999999999976e-16Initial program 21.2%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites13.7%
Taylor expanded in y around inf
Applied rewrites25.7%
if -6.59999999999999976e-16 < y < 2e5Initial program 99.7%
Taylor expanded in y around 0
lower-/.f6451.0
Applied rewrites51.0%
if 2e5 < y Initial program 11.1%
Taylor expanded in a around inf
associate-/r*N/A
lower-/.f64N/A
Applied rewrites3.8%
Taylor expanded in x around inf
Applied rewrites14.9%
Applied rewrites22.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -6.6e-16) (/ z y) (if (<= y 200000.0) (/ t i) (* y (/ x a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -6.6e-16) {
tmp = z / y;
} else if (y <= 200000.0) {
tmp = t / i;
} else {
tmp = y * (x / a);
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (y <= (-6.6d-16)) then
tmp = z / y
else if (y <= 200000.0d0) then
tmp = t / i
else
tmp = y * (x / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -6.6e-16) {
tmp = z / y;
} else if (y <= 200000.0) {
tmp = t / i;
} else {
tmp = y * (x / a);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -6.6e-16: tmp = z / y elif y <= 200000.0: tmp = t / i else: tmp = y * (x / a) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -6.6e-16) tmp = Float64(z / y); elseif (y <= 200000.0) tmp = Float64(t / i); else tmp = Float64(y * Float64(x / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -6.6e-16) tmp = z / y; elseif (y <= 200000.0) tmp = t / i; else tmp = y * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -6.6e-16], N[(z / y), $MachinePrecision], If[LessEqual[y, 200000.0], N[(t / i), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{-16}:\\
\;\;\;\;\frac{z}{y}\\
\mathbf{elif}\;y \leq 200000:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -6.59999999999999976e-16Initial program 21.2%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites13.7%
Taylor expanded in y around inf
Applied rewrites25.7%
if -6.59999999999999976e-16 < y < 2e5Initial program 99.7%
Taylor expanded in y around 0
lower-/.f6451.0
Applied rewrites51.0%
if 2e5 < y Initial program 11.1%
Taylor expanded in a around inf
associate-/r*N/A
lower-/.f64N/A
Applied rewrites3.8%
Taylor expanded in x around inf
Applied rewrites14.9%
Applied rewrites21.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -6.6e-16) (not (<= y 1.3e-21))) (/ z y) (/ t i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -6.6e-16) || !(y <= 1.3e-21)) {
tmp = z / y;
} else {
tmp = t / i;
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((y <= (-6.6d-16)) .or. (.not. (y <= 1.3d-21))) then
tmp = z / y
else
tmp = t / i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -6.6e-16) || !(y <= 1.3e-21)) {
tmp = z / y;
} else {
tmp = t / i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -6.6e-16) or not (y <= 1.3e-21): tmp = z / y else: tmp = t / i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -6.6e-16) || !(y <= 1.3e-21)) tmp = Float64(z / y); else tmp = Float64(t / i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((y <= -6.6e-16) || ~((y <= 1.3e-21))) tmp = z / y; else tmp = t / i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -6.6e-16], N[Not[LessEqual[y, 1.3e-21]], $MachinePrecision]], N[(z / y), $MachinePrecision], N[(t / i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{-16} \lor \neg \left(y \leq 1.3 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{i}\\
\end{array}
\end{array}
if y < -6.59999999999999976e-16 or 1.30000000000000009e-21 < y Initial program 19.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites13.5%
Taylor expanded in y around inf
Applied rewrites22.3%
if -6.59999999999999976e-16 < y < 1.30000000000000009e-21Initial program 99.7%
Taylor expanded in y around 0
lower-/.f6453.2
Applied rewrites53.2%
Final simplification36.4%
(FPCore (x y z t a b c i) :precision binary64 (/ z y))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return z / y;
}
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(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = z / y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return z / y;
}
def code(x, y, z, t, a, b, c, i): return z / y
function code(x, y, z, t, a, b, c, i) return Float64(z / y) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = z / y; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{y}
\end{array}
Initial program 56.3%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites52.0%
Taylor expanded in y around inf
Applied rewrites14.9%
herbie shell --seed 2025008
(FPCore (x y z t a b c i)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2"
:precision binary64
(/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))