
(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 13 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 (/ (* z (- (/ a y) 1.0)) y) -1.0 x))
(t_2 (fma (fma (+ a y) y b) y c))
(t_3 (pow t_2 2.0)))
(if (<= y -8.5e+60)
t_1
(if (<= y 2300000000.0)
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(if (<= y 4.5e+72)
(fma
(- i)
(+
(+
(/ (fma (fma y x z) y (/ t (* y y))) t_3)
(/ 230661.510616 (* t_3 y)))
(/ 27464.7644705 t_3))
(/
(+ (/ t y) (fma (fma (fma y x z) y 27464.7644705) y 230661.510616))
t_2))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(((z * ((a / y) - 1.0)) / y), -1.0, x);
double t_2 = fma(fma((a + y), y, b), y, c);
double t_3 = pow(t_2, 2.0);
double tmp;
if (y <= -8.5e+60) {
tmp = t_1;
} else if (y <= 2300000000.0) {
tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 4.5e+72) {
tmp = fma(-i, (((fma(fma(y, x, z), y, (t / (y * y))) / t_3) + (230661.510616 / (t_3 * y))) + (27464.7644705 / t_3)), (((t / y) + fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616)) / t_2));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y), -1.0, x) t_2 = fma(fma(Float64(a + y), y, b), y, c) t_3 = t_2 ^ 2.0 tmp = 0.0 if (y <= -8.5e+60) tmp = t_1; elseif (y <= 2300000000.0) tmp = 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)); elseif (y <= 4.5e+72) tmp = fma(Float64(-i), Float64(Float64(Float64(fma(fma(y, x, z), y, Float64(t / Float64(y * y))) / t_3) + Float64(230661.510616 / Float64(t_3 * y))) + Float64(27464.7644705 / t_3)), Float64(Float64(Float64(t / y) + fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616)) / t_2)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * -1.0 + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]}, Block[{t$95$3 = N[Power[t$95$2, 2.0], $MachinePrecision]}, If[LessEqual[y, -8.5e+60], t$95$1, If[LessEqual[y, 2300000000.0], 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[y, 4.5e+72], N[((-i) * N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + N[(t / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(230661.510616 / N[(t$95$3 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(27464.7644705 / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t / y), $MachinePrecision] + N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}, -1, x\right)\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)\\
t_3 := {t\_2}^{2}\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2300000000:\\
\;\;\;\;\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{elif}\;y \leq 4.5 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{fma}\left(-i, \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, \frac{t}{y \cdot y}\right)}{t\_3} + \frac{230661.510616}{t\_3 \cdot y}\right) + \frac{27464.7644705}{t\_3}, \frac{\frac{t}{y} + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)}{t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.50000000000000064e60 or 4.4999999999999998e72 < y Initial program 1.8%
Taylor expanded in y around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites54.6%
Taylor expanded in z around -inf
Applied rewrites74.4%
if -8.50000000000000064e60 < y < 2.3e9Initial program 96.9%
if 2.3e9 < y < 4.4999999999999998e72Initial program 27.1%
Taylor expanded in i around 0
Applied rewrites69.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))
1e+221)
(fma
(fma (fma (fma y x z) y 27464.7644705) y 230661.510616)
(/ y t_1)
(/ t t_1))
(fma (/ (* z (- (/ a y) 1.0)) y) -1.0 x))))
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)) <= 1e+221) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), (y / t_1), (t / t_1));
} else {
tmp = fma(((z * ((a / y) - 1.0)) / y), -1.0, x);
}
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)) <= 1e+221) tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), Float64(y / t_1), Float64(t / t_1)); else tmp = fma(Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y), -1.0, x); 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], 1e+221], N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * -1.0 + x), $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 10^{+221}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right), \frac{y}{t\_1}, \frac{t}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}, -1, x\right)\\
\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)) < 1e221Initial program 90.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites90.8%
if 1e221 < (/.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 4.7%
Taylor expanded in y around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.9%
Taylor expanded in z around -inf
Applied rewrites71.6%
(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 1e+221) t_1 (fma (/ (* z (- (/ a y) 1.0)) y) -1.0 x))))
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 <= 1e+221) {
tmp = t_1;
} else {
tmp = fma(((z * ((a / y) - 1.0)) / y), -1.0, x);
}
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 <= 1e+221) tmp = t_1; else tmp = fma(Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y), -1.0, x); end return 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, 1e+221], t$95$1, N[(N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * -1.0 + x), $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 10^{+221}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}, -1, x\right)\\
\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)) < 1e221Initial program 90.1%
if 1e221 < (/.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 4.7%
Taylor expanded in y around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.9%
Taylor expanded in z around -inf
Applied rewrites71.6%
(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))
1e+221)
(/
(fma (fma (fma z y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma (+ a y) y b) y c) y i))
(fma (/ (* z (- (/ a y) 1.0)) y) -1.0 x)))
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)) <= 1e+221) {
tmp = fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = fma(((z * ((a / y) - 1.0)) / y), -1.0, x);
}
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)) <= 1e+221) 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)); else tmp = fma(Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y), -1.0, x); 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], 1e+221], 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], N[(N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * -1.0 + x), $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 10^{+221}:\\
\;\;\;\;\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)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}, -1, x\right)\\
\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)) < 1e221Initial program 90.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 rewrites83.9%
if 1e221 < (/.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 4.7%
Taylor expanded in y around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.9%
Taylor expanded in z around -inf
Applied rewrites71.6%
(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)
(/ t i)
(* 1.0 x)))
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 = t / i;
} else {
tmp = 1.0 * x;
}
return tmp;
}
public static 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.POSITIVE_INFINITY) {
tmp = t / i;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= math.inf: tmp = t / i else: tmp = 1.0 * x 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(t / i); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= Inf) tmp = t / i; else tmp = 1.0 * x; end tmp_2 = 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[(t / i), $MachinePrecision], N[(1.0 * x), $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{t}{i}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\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 87.7%
Taylor expanded in y around 0
lower-/.f6443.9
Applied rewrites43.9%
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%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.1%
Taylor expanded in y around inf
Applied rewrites54.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= y -9.5e+60) (not (<= y 1.25e+22)))
(fma (/ (* z (- (/ a y) 1.0)) y) -1.0 x)
(/
(fma (+ 230661.510616 (* 27464.7644705 y)) 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.5e+60) || !(y <= 1.25e+22)) {
tmp = fma(((z * ((a / y) - 1.0)) / y), -1.0, x);
} else {
tmp = fma((230661.510616 + (27464.7644705 * y)), 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.5e+60) || !(y <= 1.25e+22)) tmp = fma(Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y), -1.0, x); else tmp = Float64(fma(Float64(230661.510616 + Float64(27464.7644705 * y)), 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.5e+60], N[Not[LessEqual[y, 1.25e+22]], $MachinePrecision]], N[(N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * -1.0 + x), $MachinePrecision], N[(N[(N[(230661.510616 + N[(27464.7644705 * y), $MachinePrecision]), $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 -9.5 \cdot 10^{+60} \lor \neg \left(y \leq 1.25 \cdot 10^{+22}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}, -1, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616 + 27464.7644705 \cdot y, 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.49999999999999988e60 or 1.2499999999999999e22 < y Initial program 4.3%
Taylor expanded in y around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites51.0%
Taylor expanded in z around -inf
Applied rewrites68.8%
if -9.49999999999999988e60 < y < 1.2499999999999999e22Initial 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 rewrites88.9%
Taylor expanded in y around 0
Applied rewrites82.3%
Final simplification75.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -280000000000.0) (not (<= y 7.8e+21))) (fma (/ (* z (- (/ a y) 1.0)) y) -1.0 x) (/ (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 <= -280000000000.0) || !(y <= 7.8e+21)) {
tmp = fma(((z * ((a / y) - 1.0)) / y), -1.0, x);
} 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 <= -280000000000.0) || !(y <= 7.8e+21)) tmp = fma(Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y), -1.0, x); 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, -280000000000.0], N[Not[LessEqual[y, 7.8e+21]], $MachinePrecision]], N[(N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * -1.0 + x), $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 -280000000000 \lor \neg \left(y \leq 7.8 \cdot 10^{+21}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}, -1, x\right)\\
\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 < -2.8e11 or 7.8e21 < y Initial program 7.2%
Taylor expanded in y around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites48.5%
Taylor expanded in z around -inf
Applied rewrites65.0%
if -2.8e11 < y < 7.8e21Initial program 99.0%
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 rewrites92.7%
Taylor expanded in y around 0
Applied rewrites85.0%
Final simplification74.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -0.023) (not (<= y 0.0026))) (fma (/ (* z (- (/ a y) 1.0)) y) -1.0 x) (/ (+ (* (+ (* 27464.7644705 y) 230661.510616) y) t) (+ (* 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 <= -0.023) || !(y <= 0.0026)) {
tmp = fma(((z * ((a / y) - 1.0)) / y), -1.0, x);
} else {
tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((c * y) + i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -0.023) || !(y <= 0.0026)) tmp = fma(Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y), -1.0, x); else tmp = Float64(Float64(Float64(Float64(Float64(27464.7644705 * y) + 230661.510616) * y) + t) / Float64(Float64(c * y) + i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -0.023], N[Not[LessEqual[y, 0.0026]], $MachinePrecision]], N[(N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * -1.0 + x), $MachinePrecision], N[(N[(N[(N[(N[(27464.7644705 * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(c * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.023 \lor \neg \left(y \leq 0.0026\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}, -1, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(27464.7644705 \cdot y + 230661.510616\right) \cdot y + t}{c \cdot y + i}\\
\end{array}
\end{array}
if y < -0.023 or 0.0025999999999999999 < y Initial program 13.7%
Taylor expanded in y around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites45.6%
Taylor expanded in z around -inf
Applied rewrites61.0%
if -0.023 < y < 0.0025999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-*.f6487.0
Applied rewrites87.0%
Taylor expanded in y around 0
lower-*.f6482.5
Applied rewrites82.5%
Final simplification70.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -230000000000.0) (not (<= y 0.0026))) (- x (/ (fma -1.0 z (* a x)) y)) (/ (+ (* (+ (* 27464.7644705 y) 230661.510616) y) t) (+ (* 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 <= -230000000000.0) || !(y <= 0.0026)) {
tmp = x - (fma(-1.0, z, (a * x)) / y);
} else {
tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((c * y) + i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -230000000000.0) || !(y <= 0.0026)) tmp = Float64(x - Float64(fma(-1.0, z, Float64(a * x)) / y)); else tmp = Float64(Float64(Float64(Float64(Float64(27464.7644705 * y) + 230661.510616) * y) + t) / Float64(Float64(c * y) + i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -230000000000.0], N[Not[LessEqual[y, 0.0026]], $MachinePrecision]], N[(x - N[(N[(-1.0 * z + N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(27464.7644705 * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(c * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -230000000000 \lor \neg \left(y \leq 0.0026\right):\\
\;\;\;\;x - \frac{\mathsf{fma}\left(-1, z, a \cdot x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(27464.7644705 \cdot y + 230661.510616\right) \cdot y + t}{c \cdot y + i}\\
\end{array}
\end{array}
if y < -2.3e11 or 0.0025999999999999999 < y Initial program 12.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites9.7%
Applied rewrites11.1%
Taylor expanded in y around -inf
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-fma.f64N/A
lower-*.f6456.7
Applied rewrites56.7%
if -2.3e11 < y < 0.0025999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-*.f6485.5
Applied rewrites85.5%
Taylor expanded in y around 0
lower-*.f6481.1
Applied rewrites81.1%
Final simplification67.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -2300000.0) (not (<= y 0.0026))) (- x (/ (fma -1.0 z (* a x)) y)) (/ (+ (* 230661.510616 y) t) (+ (* 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 <= -2300000.0) || !(y <= 0.0026)) {
tmp = x - (fma(-1.0, z, (a * x)) / y);
} else {
tmp = ((230661.510616 * y) + t) / ((c * y) + i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -2300000.0) || !(y <= 0.0026)) tmp = Float64(x - Float64(fma(-1.0, z, Float64(a * x)) / y)); else tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(c * y) + i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -2300000.0], N[Not[LessEqual[y, 0.0026]], $MachinePrecision]], N[(x - N[(N[(-1.0 * z + N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(c * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2300000 \lor \neg \left(y \leq 0.0026\right):\\
\;\;\;\;x - \frac{\mathsf{fma}\left(-1, z, a \cdot x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{c \cdot y + i}\\
\end{array}
\end{array}
if y < -2.3e6 or 0.0025999999999999999 < y Initial program 13.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites10.3%
Applied rewrites11.7%
Taylor expanded in y around -inf
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-fma.f64N/A
lower-*.f6456.3
Applied rewrites56.3%
if -2.3e6 < y < 0.0025999999999999999Initial program 99.8%
Taylor expanded in y around 0
lower-*.f6486.2
Applied rewrites86.2%
Taylor expanded in y around 0
lower-*.f6481.3
Applied rewrites81.3%
Final simplification67.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -3600000000.0) (not (<= y 0.0025))) (- x (/ (fma -1.0 z (* a x)) 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 <= -3600000000.0) || !(y <= 0.0025)) {
tmp = x - (fma(-1.0, z, (a * x)) / y);
} else {
tmp = t / i;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -3600000000.0) || !(y <= 0.0025)) tmp = Float64(x - Float64(fma(-1.0, z, Float64(a * x)) / y)); else tmp = Float64(t / i); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -3600000000.0], N[Not[LessEqual[y, 0.0025]], $MachinePrecision]], N[(x - N[(N[(-1.0 * z + N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t / i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3600000000 \lor \neg \left(y \leq 0.0025\right):\\
\;\;\;\;x - \frac{\mathsf{fma}\left(-1, z, a \cdot x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{i}\\
\end{array}
\end{array}
if y < -3.6e9 or 0.00250000000000000005 < y Initial program 12.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites9.7%
Applied rewrites11.1%
Taylor expanded in y around -inf
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-fma.f64N/A
lower-*.f6456.7
Applied rewrites56.7%
if -3.6e9 < y < 0.00250000000000000005Initial program 99.8%
Taylor expanded in y around 0
lower-/.f6455.9
Applied rewrites55.9%
Final simplification56.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.2e-77) (not (<= x 1.95e-139))) (* 1.0 x) (/ z y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.2e-77) || !(x <= 1.95e-139)) {
tmp = 1.0 * x;
} else {
tmp = z / 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 ((x <= (-1.2d-77)) .or. (.not. (x <= 1.95d-139))) then
tmp = 1.0d0 * x
else
tmp = z / 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 ((x <= -1.2e-77) || !(x <= 1.95e-139)) {
tmp = 1.0 * x;
} else {
tmp = z / y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.2e-77) or not (x <= 1.95e-139): tmp = 1.0 * x else: tmp = z / y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.2e-77) || !(x <= 1.95e-139)) tmp = Float64(1.0 * x); else tmp = Float64(z / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -1.2e-77) || ~((x <= 1.95e-139))) tmp = 1.0 * x; else tmp = z / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.2e-77], N[Not[LessEqual[x, 1.95e-139]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(z / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-77} \lor \neg \left(x \leq 1.95 \cdot 10^{-139}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{y}\\
\end{array}
\end{array}
if x < -1.19999999999999995e-77 or 1.95000000000000005e-139 < x Initial program 50.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites42.2%
Taylor expanded in y around inf
Applied rewrites32.3%
if -1.19999999999999995e-77 < x < 1.95000000000000005e-139Initial program 55.7%
Taylor expanded in y around -inf
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites30.7%
Taylor expanded in z around inf
Applied rewrites27.7%
Taylor expanded in y around inf
Applied rewrites28.1%
Final simplification30.9%
(FPCore (x y z t a b c i) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 1.0 * x;
}
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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 1.0 * x;
}
def code(x, y, z, t, a, b, c, i): return 1.0 * x
function code(x, y, z, t, a, b, c, i) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 52.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites39.2%
Taylor expanded in y around inf
Applied rewrites25.3%
herbie shell --seed 2024359
(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)))