
(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}
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 (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
(fma
y
(fma (fma x y z) (/ y t_1) (/ 27464.7644705 t_1))
(/ 230661.510616 t_1))
y
(/ t t_1))
(+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) 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(fma(y, fma(fma(x, y, z), (y / t_1), (27464.7644705 / t_1)), (230661.510616 / t_1)), y, (t / t_1));
} else {
tmp = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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(fma(y, fma(fma(x, y, z), Float64(y / t_1), Float64(27464.7644705 / t_1)), Float64(230661.510616 / t_1)), y, Float64(t / t_1)); else tmp = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / 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[(N[(y * N[(N[(x * y + z), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision] + N[(27464.7644705 / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(230661.510616 / t$95$1), $MachinePrecision]), $MachinePrecision] * y + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $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(\mathsf{fma}\left(y, \mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), \frac{y}{t\_1}, \frac{27464.7644705}{t\_1}\right), \frac{230661.510616}{t\_1}\right), y, \frac{t}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{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 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
Applied rewrites57.9%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6459.0
Applied rewrites59.0%
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 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.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
(/ (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) t_1)
y
(/ t t_1))
(+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) 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((fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_1), y, (t / t_1));
} else {
tmp = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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(Float64(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_1), y, Float64(t / t_1)); else tmp = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / 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[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] / t$95$1), $MachinePrecision] * y + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $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(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)}{t\_1}, y, \frac{t}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{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 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
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 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) y)))))
(if (<= y -2.75e+20)
t_1
(if (<= y 9.5e+39)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma a y b) y c) 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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.75e+20) {
tmp = t_1;
} else if (y <= 9.5e+39) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(a, y, b), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -2.75e+20) tmp = t_1; elseif (y <= 9.5e+39) tmp = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(a, y, b), y, c), 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[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.75e+20], t$95$1, If[LessEqual[y, 9.5e+39], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(a * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq -2.75 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+39}:\\
\;\;\;\;\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)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.75e20 or 9.50000000000000011e39 < y Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if -2.75e20 < y < 9.50000000000000011e39Initial program 56.3%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.3
lift-+.f64N/A
Applied rewrites56.3%
Taylor expanded in y around 0
Applied rewrites54.6%
(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 t_1)
(fma (fma (fma y x z) y 27464.7644705) y 230661.510616)
(/ t t_1))
(+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) 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 / t_1), fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), (t / t_1));
} else {
tmp = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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(Float64(y / t_1), fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), Float64(t / t_1)); else tmp = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / 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[(N[(y / t$95$1), $MachinePrecision] * N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $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(\frac{y}{t\_1}, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right), \frac{t}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{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 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.0%
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 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
INFINITY)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma (+ a y) y b) y c) y i))
(+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double 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(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = x + (-1.0 * ((z * ((a / y) - 1.0)) / y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, 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 = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); else tmp = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := 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[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * 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], N[(x + N[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\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:\\
\;\;\;\;\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)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{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 56.3%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.3
lift-+.f64N/A
Applied rewrites56.3%
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 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) y)))))
(if (<= y -2.75e+20)
t_1
(if (<= y 7.8e+39)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
(fma (fma b y c) 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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.75e+20) {
tmp = t_1;
} else if (y <= 7.8e+39) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(b, y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -2.75e+20) tmp = t_1; elseif (y <= 7.8e+39) tmp = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(b, y, c), 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[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.75e+20], t$95$1, If[LessEqual[y, 7.8e+39], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(b * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq -2.75 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+39}:\\
\;\;\;\;\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)}{\mathsf{fma}\left(\mathsf{fma}\left(b, y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.75e20 or 7.8000000000000002e39 < y Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if -2.75e20 < y < 7.8000000000000002e39Initial program 56.3%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.3
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.3
lift-+.f64N/A
Applied rewrites56.3%
Taylor expanded in y around 0
Applied rewrites51.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) y)))))
(if (<= y -2.5e+20)
t_1
(if (<= y 2.9e+39)
(/ (fma 230661.510616 y t) (fma (fma (fma (+ a y) y b) y c) 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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.5e+20) {
tmp = t_1;
} else if (y <= 2.9e+39) {
tmp = fma(230661.510616, y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -2.5e+20) tmp = t_1; elseif (y <= 2.9e+39) tmp = Float64(fma(230661.510616, y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), 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[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.5e+20], t$95$1, If[LessEqual[y, 2.9e+39], N[(N[(230661.510616 * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+39}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.5e20 or 2.90000000000000029e39 < y Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if -2.5e20 < y < 2.90000000000000029e39Initial program 56.3%
Taylor expanded in y around 0
Applied rewrites48.1%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6448.1
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites48.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) y)))))
(if (<= y -2.5e+20)
t_1
(if (<= y 5.6e+39)
(/ (fma 230661.510616 y t) (fma (+ (* (fma y y b) y) c) 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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.5e+20) {
tmp = t_1;
} else if (y <= 5.6e+39) {
tmp = fma(230661.510616, y, t) / fma(((fma(y, y, b) * y) + c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -2.5e+20) tmp = t_1; elseif (y <= 5.6e+39) tmp = Float64(fma(230661.510616, y, t) / fma(Float64(Float64(fma(y, y, b) * y) + c), 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[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.5e+20], t$95$1, If[LessEqual[y, 5.6e+39], N[(N[(230661.510616 * y + t), $MachinePrecision] / N[(N[(N[(N[(y * y + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+39}:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(y, y, b\right) \cdot y + c, y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.5e20 or 5.60000000000000003e39 < y Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if -2.5e20 < y < 5.60000000000000003e39Initial program 56.3%
Taylor expanded in y around 0
Applied rewrites48.1%
Taylor expanded in a around 0
lower-*.f64N/A
lower-+.f64N/A
lower-pow.f6446.3
Applied rewrites46.3%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6446.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6446.3
Applied rewrites46.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) y)))))
(if (<= y -2.5e+20)
t_1
(if (<= y 1.55e+38)
(/ (+ (* 230661.510616 y) t) (+ (* (+ (* b y) c) 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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.5e+20) {
tmp = t_1;
} else if (y <= 1.55e+38) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} 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 + ((-1.0d0) * ((z * ((a / y) - 1.0d0)) / y))
if (y <= (-2.5d+20)) then
tmp = t_1
else if (y <= 1.55d+38) then
tmp = ((230661.510616d0 * y) + t) / ((((b * y) + c) * y) + i)
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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.5e+20) {
tmp = t_1;
} else if (y <= 1.55e+38) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)) tmp = 0 if y <= -2.5e+20: tmp = t_1 elif y <= 1.55e+38: tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -2.5e+20) tmp = t_1; elseif (y <= 1.55e+38) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)); tmp = 0.0; if (y <= -2.5e+20) tmp = t_1; elseif (y <= 1.55e+38) tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.5e+20], t$95$1, If[LessEqual[y, 1.55e+38], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+38}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.5e20 or 1.55000000000000009e38 < y Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if -2.5e20 < y < 1.55000000000000009e38Initial program 56.3%
Taylor expanded in y around 0
Applied rewrites48.1%
Taylor expanded in y around 0
lower-*.f6445.9
Applied rewrites45.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1.0 (/ (* z (- (/ a y) 1.0)) y)))))
(if (<= y -2.4e+20)
t_1
(if (<= y 1.55e+38) (/ (+ (* 230661.510616 y) t) (+ (* c 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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.4e+20) {
tmp = t_1;
} else if (y <= 1.55e+38) {
tmp = ((230661.510616 * y) + t) / ((c * y) + i);
} 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 + ((-1.0d0) * ((z * ((a / y) - 1.0d0)) / y))
if (y <= (-2.4d+20)) then
tmp = t_1
else if (y <= 1.55d+38) then
tmp = ((230661.510616d0 * y) + t) / ((c * y) + i)
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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.4e+20) {
tmp = t_1;
} else if (y <= 1.55e+38) {
tmp = ((230661.510616 * y) + t) / ((c * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)) tmp = 0 if y <= -2.4e+20: tmp = t_1 elif y <= 1.55e+38: tmp = ((230661.510616 * y) + t) / ((c * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -2.4e+20) tmp = t_1; elseif (y <= 1.55e+38) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(c * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)); tmp = 0.0; if (y <= -2.4e+20) tmp = t_1; elseif (y <= 1.55e+38) tmp = ((230661.510616 * y) + t) / ((c * y) + i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(-1.0 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+20], t$95$1, If[LessEqual[y, 1.55e+38], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(c * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+38}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{c \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4e20 or 1.55000000000000009e38 < y Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4
Applied rewrites33.4%
if -2.4e20 < y < 1.55000000000000009e38Initial program 56.3%
Taylor expanded in y around 0
Applied rewrites48.1%
Taylor expanded in y around 0
lower-*.f6442.2
Applied rewrites42.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ (- z (* a x)) y))))
(if (<= y -6.8e+19)
t_1
(if (<= y 5.4e-10) (/ (+ (* 230661.510616 y) t) (+ (* c 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 tmp;
if (y <= -6.8e+19) {
tmp = t_1;
} else if (y <= 5.4e-10) {
tmp = ((230661.510616 * y) + t) / ((c * y) + i);
} 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 + ((z - (a * x)) / y)
if (y <= (-6.8d+19)) then
tmp = t_1
else if (y <= 5.4d-10) then
tmp = ((230661.510616d0 * y) + t) / ((c * y) + i)
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 + ((z - (a * x)) / y);
double tmp;
if (y <= -6.8e+19) {
tmp = t_1;
} else if (y <= 5.4e-10) {
tmp = ((230661.510616 * y) + t) / ((c * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + ((z - (a * x)) / y) tmp = 0 if y <= -6.8e+19: tmp = t_1 elif y <= 5.4e-10: tmp = ((230661.510616 * y) + t) / ((c * 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)) tmp = 0.0 if (y <= -6.8e+19) tmp = t_1; elseif (y <= 5.4e-10) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(c * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x + ((z - (a * x)) / y); tmp = 0.0; if (y <= -6.8e+19) tmp = t_1; elseif (y <= 5.4e-10) tmp = ((230661.510616 * y) + t) / ((c * y) + i); else tmp = t_1; end tmp_2 = 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]}, If[LessEqual[y, -6.8e+19], t$95$1, If[LessEqual[y, 5.4e-10], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(c * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z - a \cdot x}{y}\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-10}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{c \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.8e19 or 5.4e-10 < y Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
if -6.8e19 < y < 5.4e-10Initial program 56.3%
Taylor expanded in y around 0
Applied rewrites48.1%
Taylor expanded in y around 0
lower-*.f6442.2
Applied rewrites42.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y -6.8e+19)
(+ x (/ (- z (* a x)) y))
(if (<= y 5.4e-10)
(/ (+ (* 230661.510616 y) t) (+ (* c y) i))
(- (+ x (/ z y)) (/ (* a x) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -6.8e+19) {
tmp = x + ((z - (a * x)) / y);
} else if (y <= 5.4e-10) {
tmp = ((230661.510616 * y) + t) / ((c * y) + i);
} else {
tmp = (x + (z / y)) - ((a * x) / y);
}
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.8d+19)) then
tmp = x + ((z - (a * x)) / y)
else if (y <= 5.4d-10) then
tmp = ((230661.510616d0 * y) + t) / ((c * y) + i)
else
tmp = (x + (z / y)) - ((a * x) / y)
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.8e+19) {
tmp = x + ((z - (a * x)) / y);
} else if (y <= 5.4e-10) {
tmp = ((230661.510616 * y) + t) / ((c * y) + i);
} else {
tmp = (x + (z / y)) - ((a * x) / y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -6.8e+19: tmp = x + ((z - (a * x)) / y) elif y <= 5.4e-10: tmp = ((230661.510616 * y) + t) / ((c * y) + i) else: tmp = (x + (z / y)) - ((a * x) / y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -6.8e+19) tmp = Float64(x + Float64(Float64(z - Float64(a * x)) / y)); elseif (y <= 5.4e-10) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(c * y) + i)); else tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -6.8e+19) tmp = x + ((z - (a * x)) / y); elseif (y <= 5.4e-10) tmp = ((230661.510616 * y) + t) / ((c * y) + i); else tmp = (x + (z / y)) - ((a * x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -6.8e+19], N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-10], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(c * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+19}:\\
\;\;\;\;x + \frac{z - a \cdot x}{y}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-10}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{c \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\end{array}
\end{array}
if y < -6.8e19Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
if -6.8e19 < y < 5.4e-10Initial program 56.3%
Taylor expanded in y around 0
Applied rewrites48.1%
Taylor expanded in y around 0
lower-*.f6442.2
Applied rewrites42.2%
if 5.4e-10 < y Initial program 56.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6431.2
Applied rewrites31.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ (- z (* a x)) y))))
(if (<= y -2.25e-34)
t_1
(if (<= y 3e-14) (/ (+ t (* 230661.510616 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 tmp;
if (y <= -2.25e-34) {
tmp = t_1;
} else if (y <= 3e-14) {
tmp = (t + (230661.510616 * y)) / i;
} 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 + ((z - (a * x)) / y)
if (y <= (-2.25d-34)) then
tmp = t_1
else if (y <= 3d-14) then
tmp = (t + (230661.510616d0 * y)) / i
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 + ((z - (a * x)) / y);
double tmp;
if (y <= -2.25e-34) {
tmp = t_1;
} else if (y <= 3e-14) {
tmp = (t + (230661.510616 * y)) / i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + ((z - (a * x)) / y) tmp = 0 if y <= -2.25e-34: tmp = t_1 elif y <= 3e-14: tmp = (t + (230661.510616 * 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)) tmp = 0.0 if (y <= -2.25e-34) tmp = t_1; elseif (y <= 3e-14) tmp = Float64(Float64(t + Float64(230661.510616 * y)) / i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x + ((z - (a * x)) / y); tmp = 0.0; if (y <= -2.25e-34) tmp = t_1; elseif (y <= 3e-14) tmp = (t + (230661.510616 * y)) / i; else tmp = t_1; end tmp_2 = 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]}, If[LessEqual[y, -2.25e-34], t$95$1, If[LessEqual[y, 3e-14], N[(N[(t + N[(230661.510616 * y), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z - a \cdot x}{y}\\
\mathbf{if}\;y \leq -2.25 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-14}:\\
\;\;\;\;\frac{t + 230661.510616 \cdot y}{i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.25000000000000021e-34 or 2.9999999999999998e-14 < y Initial program 56.3%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites57.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
if -2.25000000000000021e-34 < y < 2.9999999999999998e-14Initial program 56.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6425.3
Applied rewrites25.3%
Taylor expanded in i around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6431.8
Applied rewrites31.8%
(FPCore (x y z t a b c i) :precision binary64 (/ (+ t (* 230661.510616 y)) i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + (230661.510616 * 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 = (t + (230661.510616d0 * 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 (t + (230661.510616 * y)) / i;
}
def code(x, y, z, t, a, b, c, i): return (t + (230661.510616 * y)) / i
function code(x, y, z, t, a, b, c, i) return Float64(Float64(t + Float64(230661.510616 * y)) / i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (t + (230661.510616 * y)) / i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + N[(230661.510616 * y), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]
\begin{array}{l}
\\
\frac{t + 230661.510616 \cdot y}{i}
\end{array}
Initial program 56.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6425.3
Applied rewrites25.3%
Taylor expanded in i around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6431.8
Applied rewrites31.8%
(FPCore (x y z t a b c i) :precision binary64 (/ t i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t / 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 = t / i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t / i;
}
def code(x, y, z, t, a, b, c, i): return t / i
function code(x, y, z, t, a, b, c, i) return Float64(t / i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t / i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t / i), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{i}
\end{array}
Initial program 56.3%
Taylor expanded in y around 0
lower-/.f6428.7
Applied rewrites28.7%
herbie shell --seed 2025149
(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)))