
(FPCore (x y z t a b)
:precision binary64
(+
x
(/
(*
y
(+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b))
(+
(* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z)
0.607771387771))))double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
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)
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
code = x + ((y * ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
def code(x, y, z, t, a, b): return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))
function code(x, y, z, t, a, b) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) end
function tmp = code(x, y, z, t, a, b) tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b)
:precision binary64
(+
x
(/
(*
y
(+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b))
(+
(* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z)
0.607771387771))))double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
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)
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
code = x + ((y * ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
def code(x, y, z, t, a, b): return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))
function code(x, y, z, t, a, b) return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) end
function tmp = code(x, y, z, t, a, b) tmp = x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(fma
(+
3.13060547623
(*
-1.0
(/
(+
36.52704169880642
(*
-1.0
(/
(+
457.9610022158428
(+
t
(*
-1.0
(/
(-
(* -1.0 a)
(+
1112.0901850848957
(* -15.234687407 (+ 457.9610022158428 t))))
z))))
z)))
z)))
y
x)))
(if (<= z -1.18e+24)
t_1
(if (<= z 1.1e+19)
(fma
(fma (fma (fma (fma 3.13060547623 z 11.1667541262) z t) z a) z b)
(/
y
(fma
(fma (fma (- z -15.234687407) z 31.4690115749) z 11.9400905721)
z
0.607771387771))
x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((3.13060547623 + (-1.0 * ((36.52704169880642 + (-1.0 * ((457.9610022158428 + (t + (-1.0 * (((-1.0 * a) - (1112.0901850848957 + (-15.234687407 * (457.9610022158428 + t)))) / z)))) / z))) / z))), y, x);
double tmp;
if (z <= -1.18e+24) {
tmp = t_1;
} else if (z <= 1.1e+19) {
tmp = fma(fma(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a), z, b), (y / fma(fma(fma((z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(3.13060547623 + Float64(-1.0 * Float64(Float64(36.52704169880642 + Float64(-1.0 * Float64(Float64(457.9610022158428 + Float64(t + Float64(-1.0 * Float64(Float64(Float64(-1.0 * a) - Float64(1112.0901850848957 + Float64(-15.234687407 * Float64(457.9610022158428 + t)))) / z)))) / z))) / z))), y, x) tmp = 0.0 if (z <= -1.18e+24) tmp = t_1; elseif (z <= 1.1e+19) tmp = fma(fma(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a), z, b), Float64(y / fma(fma(fma(Float64(z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(3.13060547623 + N[(-1.0 * N[(N[(36.52704169880642 + N[(-1.0 * N[(N[(457.9610022158428 + N[(t + N[(-1.0 * N[(N[(N[(-1.0 * a), $MachinePrecision] - N[(1112.0901850848957 + N[(-15.234687407 * N[(457.9610022158428 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[z, -1.18e+24], t$95$1, If[LessEqual[z, 1.1e+19], N[(N[(N[(N[(N[(3.13060547623 * z + 11.1667541262), $MachinePrecision] * z + t), $MachinePrecision] * z + a), $MachinePrecision] * z + b), $MachinePrecision] * N[(y / N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z + 31.4690115749), $MachinePrecision] * z + 11.9400905721), $MachinePrecision] * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(3.13060547623 + -1 \cdot \frac{36.52704169880642 + -1 \cdot \frac{457.9610022158428 + \left(t + -1 \cdot \frac{-1 \cdot a - \left(1112.0901850848957 + -15.234687407 \cdot \left(457.9610022158428 + t\right)\right)}{z}\right)}{z}}{z}, y, x\right)\\
\mathbf{if}\;z \leq -1.18 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), z, t\right), z, a\right), z, b\right), \frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z - -15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.17999999999999997e24 or 1.1e19 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around -inf
Applied rewrites56.1%
if -1.17999999999999997e24 < z < 1.1e19Initial program 58.6%
Applied rewrites60.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(fma
(fma (fma (- z -15.234687407) z 31.4690115749) z 11.9400905721)
z
0.607771387771)))
(if (<=
(+
x
(/
(*
y
(+
(* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z)
b))
(+
(*
(+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721)
z)
0.607771387771)))
INFINITY)
(fma
y
(* z (/ (fma (fma (fma 3.13060547623 z 11.1667541262) z t) z a) t_1))
(fma b (/ y t_1) x))
(fma
(-
(+
3.13060547623
(fma
1112.0901850848957
(/ 1.0 (pow z 3.0))
(+
(/ 457.9610022158428 (pow z 2.0))
(+ (/ a (pow z 3.0)) (/ t (pow z 2.0))))))
(fma
15.234687407
(/ (+ 457.9610022158428 t) (pow z 3.0))
(* 36.52704169880642 (/ 1.0 z))))
y
x))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(fma(fma((z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771);
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = fma(y, (z * (fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a) / t_1)), fma(b, (y / t_1), x));
} else {
tmp = fma(((3.13060547623 + fma(1112.0901850848957, (1.0 / pow(z, 3.0)), ((457.9610022158428 / pow(z, 2.0)) + ((a / pow(z, 3.0)) + (t / pow(z, 2.0)))))) - fma(15.234687407, ((457.9610022158428 + t) / pow(z, 3.0)), (36.52704169880642 * (1.0 / z)))), y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(fma(fma(Float64(z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = fma(y, Float64(z * Float64(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a) / t_1)), fma(b, Float64(y / t_1), x)); else tmp = fma(Float64(Float64(3.13060547623 + fma(1112.0901850848957, Float64(1.0 / (z ^ 3.0)), Float64(Float64(457.9610022158428 / (z ^ 2.0)) + Float64(Float64(a / (z ^ 3.0)) + Float64(t / (z ^ 2.0)))))) - fma(15.234687407, Float64(Float64(457.9610022158428 + t) / (z ^ 3.0)), Float64(36.52704169880642 * Float64(1.0 / z)))), y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z + 31.4690115749), $MachinePrecision] * z + 11.9400905721), $MachinePrecision] * z + 0.607771387771), $MachinePrecision]}, If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(y * N[(z * N[(N[(N[(N[(3.13060547623 * z + 11.1667541262), $MachinePrecision] * z + t), $MachinePrecision] * z + a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(y / t$95$1), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(3.13060547623 + N[(1112.0901850848957 * N[(1.0 / N[Power[z, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(457.9610022158428 / N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[Power[z, 3.0], $MachinePrecision]), $MachinePrecision] + N[(t / N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(15.234687407 * N[(N[(457.9610022158428 + t), $MachinePrecision] / N[Power[z, 3.0], $MachinePrecision]), $MachinePrecision] + N[(36.52704169880642 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z - -15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)\\
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, z \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), z, t\right), z, a\right)}{t\_1}, \mathsf{fma}\left(b, \frac{y}{t\_1}, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(3.13060547623 + \mathsf{fma}\left(1112.0901850848957, \frac{1}{{z}^{3}}, \frac{457.9610022158428}{{z}^{2}} + \left(\frac{a}{{z}^{3}} + \frac{t}{{z}^{2}}\right)\right)\right) - \mathsf{fma}\left(15.234687407, \frac{457.9610022158428 + t}{{z}^{3}}, 36.52704169880642 \cdot \frac{1}{z}\right), y, x\right)\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.6%
Applied rewrites63.6%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around inf
lower--.f64N/A
Applied rewrites52.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(fma
(fma (fma (- z -15.234687407) z 31.4690115749) z 11.9400905721)
z
0.607771387771)))
(if (<=
(+
x
(/
(*
y
(+
(* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z)
b))
(+
(*
(+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721)
z)
0.607771387771)))
INFINITY)
(fma
y
(* z (/ (fma (fma (fma 3.13060547623 z 11.1667541262) z t) z a) t_1))
(fma b (/ y t_1) x))
(fma
(+
3.13060547623
(*
-1.0
(/
(+
36.52704169880642
(*
-1.0
(/
(+
457.9610022158428
(+
t
(*
-1.0
(/
(-
(* -1.0 a)
(+
1112.0901850848957
(* -15.234687407 (+ 457.9610022158428 t))))
z))))
z)))
z)))
y
x))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(fma(fma((z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771);
double tmp;
if ((x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= ((double) INFINITY)) {
tmp = fma(y, (z * (fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a) / t_1)), fma(b, (y / t_1), x));
} else {
tmp = fma((3.13060547623 + (-1.0 * ((36.52704169880642 + (-1.0 * ((457.9610022158428 + (t + (-1.0 * (((-1.0 * a) - (1112.0901850848957 + (-15.234687407 * (457.9610022158428 + t)))) / z)))) / z))) / z))), y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(fma(fma(Float64(z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771) tmp = 0.0 if (Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))) <= Inf) tmp = fma(y, Float64(z * Float64(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a) / t_1)), fma(b, Float64(y / t_1), x)); else tmp = fma(Float64(3.13060547623 + Float64(-1.0 * Float64(Float64(36.52704169880642 + Float64(-1.0 * Float64(Float64(457.9610022158428 + Float64(t + Float64(-1.0 * Float64(Float64(Float64(-1.0 * a) - Float64(1112.0901850848957 + Float64(-15.234687407 * Float64(457.9610022158428 + t)))) / z)))) / z))) / z))), y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z + 31.4690115749), $MachinePrecision] * z + 11.9400905721), $MachinePrecision] * z + 0.607771387771), $MachinePrecision]}, If[LessEqual[N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(y * N[(z * N[(N[(N[(N[(3.13060547623 * z + 11.1667541262), $MachinePrecision] * z + t), $MachinePrecision] * z + a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(y / t$95$1), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(3.13060547623 + N[(-1.0 * N[(N[(36.52704169880642 + N[(-1.0 * N[(N[(457.9610022158428 + N[(t + N[(-1.0 * N[(N[(N[(-1.0 * a), $MachinePrecision] - N[(1112.0901850848957 + N[(-15.234687407 * N[(457.9610022158428 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z - -15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)\\
\mathbf{if}\;x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, z \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), z, t\right), z, a\right)}{t\_1}, \mathsf{fma}\left(b, \frac{y}{t\_1}, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623 + -1 \cdot \frac{36.52704169880642 + -1 \cdot \frac{457.9610022158428 + \left(t + -1 \cdot \frac{-1 \cdot a - \left(1112.0901850848957 + -15.234687407 \cdot \left(457.9610022158428 + t\right)\right)}{z}\right)}{z}}{z}, y, x\right)\\
\end{array}
if (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) < +inf.0Initial program 58.6%
Applied rewrites63.6%
if +inf.0 < (+.f64 x (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64)))) Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around -inf
Applied rewrites56.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(fma
(+
3.13060547623
(*
-1.0
(/
(+ 36.52704169880642 (* -1.0 (/ (+ 457.9610022158428 t) z)))
z)))
y
x)))
(if (<= z -2.1e+35)
t_1
(if (<= z 4.2e+24)
(fma
(fma (fma (fma (fma 3.13060547623 z 11.1667541262) z t) z a) z b)
(/
y
(fma
(fma (fma (- z -15.234687407) z 31.4690115749) z 11.9400905721)
z
0.607771387771))
x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((3.13060547623 + (-1.0 * ((36.52704169880642 + (-1.0 * ((457.9610022158428 + t) / z))) / z))), y, x);
double tmp;
if (z <= -2.1e+35) {
tmp = t_1;
} else if (z <= 4.2e+24) {
tmp = fma(fma(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a), z, b), (y / fma(fma(fma((z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(3.13060547623 + Float64(-1.0 * Float64(Float64(36.52704169880642 + Float64(-1.0 * Float64(Float64(457.9610022158428 + t) / z))) / z))), y, x) tmp = 0.0 if (z <= -2.1e+35) tmp = t_1; elseif (z <= 4.2e+24) tmp = fma(fma(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a), z, b), Float64(y / fma(fma(fma(Float64(z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(3.13060547623 + N[(-1.0 * N[(N[(36.52704169880642 + N[(-1.0 * N[(N[(457.9610022158428 + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[z, -2.1e+35], t$95$1, If[LessEqual[z, 4.2e+24], N[(N[(N[(N[(N[(3.13060547623 * z + 11.1667541262), $MachinePrecision] * z + t), $MachinePrecision] * z + a), $MachinePrecision] * z + b), $MachinePrecision] * N[(y / N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z + 31.4690115749), $MachinePrecision] * z + 11.9400905721), $MachinePrecision] * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(3.13060547623 + -1 \cdot \frac{36.52704169880642 + -1 \cdot \frac{457.9610022158428 + t}{z}}{z}, y, x\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), z, t\right), z, a\right), z, b\right), \frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z - -15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.0999999999999999e35 or 4.2000000000000003e24 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6455.8
Applied rewrites55.8%
if -2.0999999999999999e35 < z < 4.2000000000000003e24Initial program 58.6%
Applied rewrites60.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(fma
(+
3.13060547623
(*
-1.0
(/
(+ 36.52704169880642 (* -1.0 (/ (+ 457.9610022158428 t) z)))
z)))
y
x)))
(if (<= z -1.46e+32)
t_1
(if (<= z 4.2e+24)
(fma
(/
(+ b (* z (+ a (* t z))))
(fma
(fma (fma (- z -15.234687407) z 31.4690115749) z 11.9400905721)
z
0.607771387771))
y
x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((3.13060547623 + (-1.0 * ((36.52704169880642 + (-1.0 * ((457.9610022158428 + t) / z))) / z))), y, x);
double tmp;
if (z <= -1.46e+32) {
tmp = t_1;
} else if (z <= 4.2e+24) {
tmp = fma(((b + (z * (a + (t * z)))) / fma(fma(fma((z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(3.13060547623 + Float64(-1.0 * Float64(Float64(36.52704169880642 + Float64(-1.0 * Float64(Float64(457.9610022158428 + t) / z))) / z))), y, x) tmp = 0.0 if (z <= -1.46e+32) tmp = t_1; elseif (z <= 4.2e+24) tmp = fma(Float64(Float64(b + Float64(z * Float64(a + Float64(t * z)))) / fma(fma(fma(Float64(z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(3.13060547623 + N[(-1.0 * N[(N[(36.52704169880642 + N[(-1.0 * N[(N[(457.9610022158428 + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[z, -1.46e+32], t$95$1, If[LessEqual[z, 4.2e+24], N[(N[(N[(b + N[(z * N[(a + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(z - -15.234687407), $MachinePrecision] * z + 31.4690115749), $MachinePrecision] * z + 11.9400905721), $MachinePrecision] * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(3.13060547623 + -1 \cdot \frac{36.52704169880642 + -1 \cdot \frac{457.9610022158428 + t}{z}}{z}, y, x\right)\\
\mathbf{if}\;z \leq -1.46 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(\frac{b + z \cdot \left(a + t \cdot z\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z - -15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.46000000000000005e32 or 4.2000000000000003e24 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6455.8
Applied rewrites55.8%
if -1.46000000000000005e32 < z < 4.2000000000000003e24Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6463.8
Applied rewrites63.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(fma
(+
3.13060547623
(*
-1.0
(/
(+ 36.52704169880642 (* -1.0 (/ (+ 457.9610022158428 t) z)))
z)))
y
x)))
(if (<= z -13.0)
t_1
(if (<= z 40000.0)
(fma
(/ (+ b (* z (+ a (* t z)))) (fma 11.9400905721 z 0.607771387771))
y
x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((3.13060547623 + (-1.0 * ((36.52704169880642 + (-1.0 * ((457.9610022158428 + t) / z))) / z))), y, x);
double tmp;
if (z <= -13.0) {
tmp = t_1;
} else if (z <= 40000.0) {
tmp = fma(((b + (z * (a + (t * z)))) / fma(11.9400905721, z, 0.607771387771)), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(3.13060547623 + Float64(-1.0 * Float64(Float64(36.52704169880642 + Float64(-1.0 * Float64(Float64(457.9610022158428 + t) / z))) / z))), y, x) tmp = 0.0 if (z <= -13.0) tmp = t_1; elseif (z <= 40000.0) tmp = fma(Float64(Float64(b + Float64(z * Float64(a + Float64(t * z)))) / fma(11.9400905721, z, 0.607771387771)), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(3.13060547623 + N[(-1.0 * N[(N[(36.52704169880642 + N[(-1.0 * N[(N[(457.9610022158428 + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[z, -13.0], t$95$1, If[LessEqual[z, 40000.0], N[(N[(N[(b + N[(z * N[(a + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(11.9400905721 * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(3.13060547623 + -1 \cdot \frac{36.52704169880642 + -1 \cdot \frac{457.9610022158428 + t}{z}}{z}, y, x\right)\\
\mathbf{if}\;z \leq -13:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 40000:\\
\;\;\;\;\mathsf{fma}\left(\frac{b + z \cdot \left(a + t \cdot z\right)}{\mathsf{fma}\left(11.9400905721, z, 0.607771387771\right)}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -13 or 4e4 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6455.8
Applied rewrites55.8%
if -13 < z < 4e4Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around 0
Applied rewrites62.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6458.9
Applied rewrites58.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -13.0)
(fma 3.13060547623 y x)
(if (<= z 3e+42)
(fma
(/ (+ b (* z (+ a (* t z)))) (fma 11.9400905721 z 0.607771387771))
y
x)
(fma 3.13060547623 y x))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -13.0) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 3e+42) {
tmp = fma(((b + (z * (a + (t * z)))) / fma(11.9400905721, z, 0.607771387771)), y, x);
} else {
tmp = fma(3.13060547623, y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -13.0) tmp = fma(3.13060547623, y, x); elseif (z <= 3e+42) tmp = fma(Float64(Float64(b + Float64(z * Float64(a + Float64(t * z)))) / fma(11.9400905721, z, 0.607771387771)), y, x); else tmp = fma(3.13060547623, y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -13.0], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 3e+42], N[(N[(N[(b + N[(z * N[(a + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(11.9400905721 * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -13:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(\frac{b + z \cdot \left(a + t \cdot z\right)}{\mathsf{fma}\left(11.9400905721, z, 0.607771387771\right)}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\end{array}
if z < -13 or 3.00000000000000029e42 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around inf
Applied rewrites62.3%
if -13 < z < 3.00000000000000029e42Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around 0
Applied rewrites62.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6458.9
Applied rewrites58.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -6.8e+31)
(fma 3.13060547623 y x)
(if (<= z 45000.0)
(fma y (* 1.6453555072203998 (* a z)) (fma b (/ y 0.607771387771) x))
(fma 3.13060547623 y x))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6.8e+31) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 45000.0) {
tmp = fma(y, (1.6453555072203998 * (a * z)), fma(b, (y / 0.607771387771), x));
} else {
tmp = fma(3.13060547623, y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6.8e+31) tmp = fma(3.13060547623, y, x); elseif (z <= 45000.0) tmp = fma(y, Float64(1.6453555072203998 * Float64(a * z)), fma(b, Float64(y / 0.607771387771), x)); else tmp = fma(3.13060547623, y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6.8e+31], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 45000.0], N[(y * N[(1.6453555072203998 * N[(a * z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(y / 0.607771387771), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 45000:\\
\;\;\;\;\mathsf{fma}\left(y, 1.6453555072203998 \cdot \left(a \cdot z\right), \mathsf{fma}\left(b, \frac{y}{0.607771387771}, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\end{array}
if z < -6.7999999999999996e31 or 45000 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around inf
Applied rewrites62.3%
if -6.7999999999999996e31 < z < 45000Initial program 58.6%
Applied rewrites63.6%
Taylor expanded in z around 0
Applied rewrites55.6%
Taylor expanded in z around 0
Applied rewrites54.7%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6459.4
Applied rewrites59.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -56.0)
(fma 3.13060547623 y x)
(if (<= z 45000.0)
(fma (/ (+ b (* a z)) (fma 11.9400905721 z 0.607771387771)) y x)
(fma 3.13060547623 y x))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -56.0) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 45000.0) {
tmp = fma(((b + (a * z)) / fma(11.9400905721, z, 0.607771387771)), y, x);
} else {
tmp = fma(3.13060547623, y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -56.0) tmp = fma(3.13060547623, y, x); elseif (z <= 45000.0) tmp = fma(Float64(Float64(b + Float64(a * z)) / fma(11.9400905721, z, 0.607771387771)), y, x); else tmp = fma(3.13060547623, y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -56.0], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 45000.0], N[(N[(N[(b + N[(a * z), $MachinePrecision]), $MachinePrecision] / N[(11.9400905721 * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -56:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 45000:\\
\;\;\;\;\mathsf{fma}\left(\frac{b + a \cdot z}{\mathsf{fma}\left(11.9400905721, z, 0.607771387771\right)}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\end{array}
if z < -56 or 45000 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around inf
Applied rewrites62.3%
if -56 < z < 45000Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around 0
Applied rewrites62.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f6463.7
Applied rewrites63.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.15e+54)
(fma 3.13060547623 y x)
(if (<= z 45000.0)
(+ x (* 1.6453555072203998 (* b y)))
(fma 3.13060547623 y x))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.15e+54) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 45000.0) {
tmp = x + (1.6453555072203998 * (b * y));
} else {
tmp = fma(3.13060547623, y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.15e+54) tmp = fma(3.13060547623, y, x); elseif (z <= 45000.0) tmp = Float64(x + Float64(1.6453555072203998 * Float64(b * y))); else tmp = fma(3.13060547623, y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.15e+54], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 45000.0], N[(x + N[(1.6453555072203998 * N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 45000:\\
\;\;\;\;x + 1.6453555072203998 \cdot \left(b \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\end{array}
if z < -2.14999999999999988e54 or 45000 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around inf
Applied rewrites62.3%
if -2.14999999999999988e54 < z < 45000Initial program 58.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.15e+54)
(fma 3.13060547623 y x)
(if (<= z 45000.0)
(fma (* 1.6453555072203998 b) y x)
(fma 3.13060547623 y x))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.15e+54) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 45000.0) {
tmp = fma((1.6453555072203998 * b), y, x);
} else {
tmp = fma(3.13060547623, y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.15e+54) tmp = fma(3.13060547623, y, x); elseif (z <= 45000.0) tmp = fma(Float64(1.6453555072203998 * b), y, x); else tmp = fma(3.13060547623, y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.15e+54], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 45000.0], N[(N[(1.6453555072203998 * b), $MachinePrecision] * y + x), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 45000:\\
\;\;\;\;\mathsf{fma}\left(1.6453555072203998 \cdot b, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\end{array}
if z < -2.14999999999999988e54 or 45000 < z Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around inf
Applied rewrites62.3%
if -2.14999999999999988e54 < z < 45000Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around 0
lower-*.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a b) :precision binary64 (fma 3.13060547623 y x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(3.13060547623, y, x);
}
function code(x, y, z, t, a, b) return fma(3.13060547623, y, x) end
code[x_, y_, z_, t_, a_, b_] := N[(3.13060547623 * y + x), $MachinePrecision]
\mathsf{fma}\left(3.13060547623, y, x\right)
Initial program 58.6%
Taylor expanded in z around 0
Applied rewrites63.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.0%
Taylor expanded in z around inf
Applied rewrites62.3%
(FPCore (x y z t a b) :precision binary64 (* x 1.0))
double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
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)
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
code = x * 1.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
def code(x, y, z, t, a, b): return x * 1.0
function code(x, y, z, t, a, b) return Float64(x * 1.0) end
function tmp = code(x, y, z, t, a, b) tmp = x * 1.0; end
code[x_, y_, z_, t_, a_, b_] := N[(x * 1.0), $MachinePrecision]
x \cdot 1
Initial program 58.6%
Taylor expanded in x around inf
Applied rewrites52.9%
Taylor expanded in x around inf
Applied rewrites44.9%
herbie shell --seed 2025166
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, D"
:precision binary64
(+ x (/ (* y (+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b)) (+ (* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z) 0.607771387771))))