
(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]
\begin{array}{l}
\\
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}
\end{array}
Herbie found 14 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]
\begin{array}{l}
\\
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}
\end{array}
(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) 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) / 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 + t) / 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 + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\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 + t}{z}}{z}, y, x\right)\\
\end{array}
\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 59.2%
Applied rewrites63.5%
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 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
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.4
Applied rewrites55.4%
(FPCore (x y z t a b)
:precision binary64
(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
(/
(fma (fma (fma (fma 3.13060547623 z 11.1667541262) z t) z a) z b)
(fma
(fma (fma (- z -15.234687407) z 31.4690115749) z 11.9400905721)
z
0.607771387771))
y
x)
(fma
(+
3.13060547623
(*
-1.0
(/ (+ 36.52704169880642 (* -1.0 (/ (+ 457.9610022158428 t) z))) z)))
y
x)))
double code(double x, double y, double z, double t, double a, double b) {
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((fma(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a), z, b) / fma(fma(fma((z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)), y, x);
} else {
tmp = fma((3.13060547623 + (-1.0 * ((36.52704169880642 + (-1.0 * ((457.9610022158428 + t) / z))) / z))), y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) 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(Float64(fma(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a), z, b) / fma(fma(fma(Float64(z - -15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)), y, x); else tmp = fma(Float64(3.13060547623 + Float64(-1.0 * Float64(Float64(36.52704169880642 + Float64(-1.0 * Float64(Float64(457.9610022158428 + t) / z))) / z))), y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := 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[(N[(N[(N[(N[(N[(3.13060547623 * z + 11.1667541262), $MachinePrecision] * z + t), $MachinePrecision] * z + a), $MachinePrecision] * z + b), $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], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\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(\frac{\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)}{\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}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623 + -1 \cdot \frac{36.52704169880642 + -1 \cdot \frac{457.9610022158428 + t}{z}}{z}, y, x\right)\\
\end{array}
\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 59.2%
Applied rewrites61.2%
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 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
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.4
Applied rewrites55.4%
(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 -3.95e+18)
t_1
(if (<= z 3.2e+44)
(fma
(/
(fma (fma t z a) z b)
(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 <= -3.95e+18) {
tmp = t_1;
} else if (z <= 3.2e+44) {
tmp = fma((fma(fma(t, z, a), z, b) / 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 <= -3.95e+18) tmp = t_1; elseif (z <= 3.2e+44) tmp = fma(Float64(fma(fma(t, z, a), z, b) / 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, -3.95e+18], t$95$1, If[LessEqual[z, 3.2e+44], N[(N[(N[(N[(t * z + a), $MachinePrecision] * z + b), $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}
\\
\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 -3.95 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(t, z, a\right), z, b\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}
\end{array}
if z < -3.95e18 or 3.20000000000000004e44 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
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.4
Applied rewrites55.4%
if -3.95e18 < z < 3.20000000000000004e44Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites62.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites64.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.16e+17)
t_1
(if (<= z 260000.0)
(fma
(fma (fma t z a) z b)
(/ y (fma (fma 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.16e+17) {
tmp = t_1;
} else if (z <= 260000.0) {
tmp = fma(fma(fma(t, z, a), z, b), (y / fma(fma(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.16e+17) tmp = t_1; elseif (z <= 260000.0) tmp = fma(fma(fma(t, z, a), z, b), Float64(y / fma(fma(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.16e+17], t$95$1, If[LessEqual[z, 260000.0], N[(N[(N[(t * z + a), $MachinePrecision] * z + b), $MachinePrecision] * N[(y / N[(N[(31.4690115749 * z + 11.9400905721), $MachinePrecision] * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\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.16 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 260000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t, z, a\right), z, b\right), \frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(31.4690115749, z, 11.9400905721\right), z, 0.607771387771\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.16e17 or 2.6e5 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
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.4
Applied rewrites55.4%
if -2.16e17 < z < 2.6e5Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites62.8%
Applied rewrites63.8%
Taylor expanded in z around 0
Applied rewrites61.0%
(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 -4100000000.0)
t_1
(if (<= z 185000.0)
(fma (fma (fma t z a) z b) (/ y (fma 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 <= -4100000000.0) {
tmp = t_1;
} else if (z <= 185000.0) {
tmp = fma(fma(fma(t, z, a), z, b), (y / fma(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 <= -4100000000.0) tmp = t_1; elseif (z <= 185000.0) tmp = fma(fma(fma(t, z, a), z, b), Float64(y / fma(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, -4100000000.0], t$95$1, If[LessEqual[z, 185000.0], N[(N[(N[(t * z + a), $MachinePrecision] * z + b), $MachinePrecision] * N[(y / N[(11.9400905721 * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\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 -4100000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 185000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t, z, a\right), z, b\right), \frac{y}{\mathsf{fma}\left(11.9400905721, z, 0.607771387771\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.1e9 or 185000 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
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.4
Applied rewrites55.4%
if -4.1e9 < z < 185000Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites62.8%
Applied rewrites63.8%
Taylor expanded in z around 0
Applied rewrites59.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -7.5e+18)
(fma 3.13060547623 y x)
(if (<= z 1060000.0)
(fma (fma (fma t z a) z b) (* 1.6453555072203998 y) x)
(+
x
(-
(fma 3.13060547623 y (* 11.1667541262 (/ y z)))
(* 47.69379582500642 (/ y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.5e+18) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 1060000.0) {
tmp = fma(fma(fma(t, z, a), z, b), (1.6453555072203998 * y), x);
} else {
tmp = x + (fma(3.13060547623, y, (11.1667541262 * (y / z))) - (47.69379582500642 * (y / z)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.5e+18) tmp = fma(3.13060547623, y, x); elseif (z <= 1060000.0) tmp = fma(fma(fma(t, z, a), z, b), Float64(1.6453555072203998 * y), x); else tmp = Float64(x + Float64(fma(3.13060547623, y, Float64(11.1667541262 * Float64(y / z))) - Float64(47.69379582500642 * Float64(y / z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.5e+18], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 1060000.0], N[(N[(N[(t * z + a), $MachinePrecision] * z + b), $MachinePrecision] * N[(1.6453555072203998 * y), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(N[(3.13060547623 * y + N[(11.1667541262 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(47.69379582500642 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 1060000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t, z, a\right), z, b\right), 1.6453555072203998 \cdot y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(3.13060547623, y, 11.1667541262 \cdot \frac{y}{z}\right) - 47.69379582500642 \cdot \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -7.5e18Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
if -7.5e18 < z < 1.06e6Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites62.8%
Applied rewrites63.8%
Taylor expanded in z around 0
lower-*.f6457.8
Applied rewrites57.8%
if 1.06e6 < z Initial program 59.2%
Taylor expanded in z around inf
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6456.0
Applied rewrites56.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -7.5e+18)
(fma 3.13060547623 y x)
(if (<= z 1060000.0)
(fma (fma (fma t z a) z b) (* 1.6453555072203998 y) x)
(fma (- 3.13060547623 (* 36.52704169880642 (/ 1.0 z))) y x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.5e+18) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 1060000.0) {
tmp = fma(fma(fma(t, z, a), z, b), (1.6453555072203998 * y), x);
} else {
tmp = fma((3.13060547623 - (36.52704169880642 * (1.0 / z))), y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.5e+18) tmp = fma(3.13060547623, y, x); elseif (z <= 1060000.0) tmp = fma(fma(fma(t, z, a), z, b), Float64(1.6453555072203998 * y), x); else tmp = fma(Float64(3.13060547623 - Float64(36.52704169880642 * Float64(1.0 / z))), y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.5e+18], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 1060000.0], N[(N[(N[(t * z + a), $MachinePrecision] * z + b), $MachinePrecision] * N[(1.6453555072203998 * y), $MachinePrecision] + x), $MachinePrecision], N[(N[(3.13060547623 - N[(36.52704169880642 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 1060000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t, z, a\right), z, b\right), 1.6453555072203998 \cdot y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623 - 36.52704169880642 \cdot \frac{1}{z}, y, x\right)\\
\end{array}
\end{array}
if z < -7.5e18Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
if -7.5e18 < z < 1.06e6Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites62.8%
Applied rewrites63.8%
Taylor expanded in z around 0
lower-*.f6457.8
Applied rewrites57.8%
if 1.06e6 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
lower--.f64N/A
lower-*.f64N/A
lower-/.f6458.5
Applied rewrites58.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.6e+15)
(fma 3.13060547623 y x)
(if (<= z 1060000.0)
(+ x (/ (* y (+ (* a z) b)) 0.607771387771))
(fma (- 3.13060547623 (* 36.52704169880642 (/ 1.0 z))) y x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.6e+15) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 1060000.0) {
tmp = x + ((y * ((a * z) + b)) / 0.607771387771);
} else {
tmp = fma((3.13060547623 - (36.52704169880642 * (1.0 / z))), y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.6e+15) tmp = fma(3.13060547623, y, x); elseif (z <= 1060000.0) tmp = Float64(x + Float64(Float64(y * Float64(Float64(a * z) + b)) / 0.607771387771)); else tmp = fma(Float64(3.13060547623 - Float64(36.52704169880642 * Float64(1.0 / z))), y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.6e+15], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 1060000.0], N[(x + N[(N[(y * N[(N[(a * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / 0.607771387771), $MachinePrecision]), $MachinePrecision], N[(N[(3.13060547623 - N[(36.52704169880642 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 1060000:\\
\;\;\;\;x + \frac{y \cdot \left(a \cdot z + b\right)}{0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623 - 36.52704169880642 \cdot \frac{1}{z}, y, x\right)\\
\end{array}
\end{array}
if z < -1.6e15Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
if -1.6e15 < z < 1.06e6Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites62.8%
Taylor expanded in z around 0
Applied rewrites57.8%
Taylor expanded in z around 0
Applied rewrites60.1%
if 1.06e6 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
lower--.f64N/A
lower-*.f64N/A
lower-/.f6458.5
Applied rewrites58.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.5e+20)
(fma 3.13060547623 y x)
(if (<= z 1.75)
(+ x (/ (* y b) (+ (* 11.9400905721 z) 0.607771387771)))
(fma (- 3.13060547623 (* 36.52704169880642 (/ 1.0 z))) y x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.5e+20) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 1.75) {
tmp = x + ((y * b) / ((11.9400905721 * z) + 0.607771387771));
} else {
tmp = fma((3.13060547623 - (36.52704169880642 * (1.0 / z))), y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.5e+20) tmp = fma(3.13060547623, y, x); elseif (z <= 1.75) tmp = Float64(x + Float64(Float64(y * b) / Float64(Float64(11.9400905721 * z) + 0.607771387771))); else tmp = fma(Float64(3.13060547623 - Float64(36.52704169880642 * Float64(1.0 / z))), y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.5e+20], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 1.75], N[(x + N[(N[(y * b), $MachinePrecision] / N[(N[(11.9400905721 * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(3.13060547623 - N[(36.52704169880642 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 1.75:\\
\;\;\;\;x + \frac{y \cdot b}{11.9400905721 \cdot z + 0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623 - 36.52704169880642 \cdot \frac{1}{z}, y, x\right)\\
\end{array}
\end{array}
if z < -5.5e20Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
if -5.5e20 < z < 1.75Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
Taylor expanded in z around 0
Applied rewrites63.3%
if 1.75 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
lower--.f64N/A
lower-*.f64N/A
lower-/.f6458.5
Applied rewrites58.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.5e+20)
(fma 3.13060547623 y x)
(if (<= z 1.75)
(fma (/ b (fma 11.9400905721 z 0.607771387771)) y x)
(fma (- 3.13060547623 (* 36.52704169880642 (/ 1.0 z))) y x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.5e+20) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 1.75) {
tmp = fma((b / fma(11.9400905721, z, 0.607771387771)), y, x);
} else {
tmp = fma((3.13060547623 - (36.52704169880642 * (1.0 / z))), y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.5e+20) tmp = fma(3.13060547623, y, x); elseif (z <= 1.75) tmp = fma(Float64(b / fma(11.9400905721, z, 0.607771387771)), y, x); else tmp = fma(Float64(3.13060547623 - Float64(36.52704169880642 * Float64(1.0 / z))), y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.5e+20], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 1.75], N[(N[(b / N[(11.9400905721 * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(3.13060547623 - N[(36.52704169880642 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 1.75:\\
\;\;\;\;\mathsf{fma}\left(\frac{b}{\mathsf{fma}\left(11.9400905721, z, 0.607771387771\right)}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623 - 36.52704169880642 \cdot \frac{1}{z}, y, x\right)\\
\end{array}
\end{array}
if z < -5.5e20Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
if -5.5e20 < z < 1.75Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around 0
Applied rewrites63.6%
if 1.75 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
lower--.f64N/A
lower-*.f64N/A
lower-/.f6458.5
Applied rewrites58.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -8.2e+14)
(fma 3.13060547623 y x)
(if (<= z 980000.0)
(+ x (* (* 1.6453555072203998 y) b))
(fma 3.13060547623 y x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.2e+14) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 980000.0) {
tmp = x + ((1.6453555072203998 * y) * b);
} else {
tmp = fma(3.13060547623, y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8.2e+14) tmp = fma(3.13060547623, y, x); elseif (z <= 980000.0) tmp = Float64(x + Float64(Float64(1.6453555072203998 * y) * b)); else tmp = fma(3.13060547623, y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.2e+14], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 980000.0], N[(x + N[(N[(1.6453555072203998 * y), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 980000:\\
\;\;\;\;x + \left(1.6453555072203998 \cdot y\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\end{array}
\end{array}
if z < -8.2e14 or 9.8e5 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
if -8.2e14 < z < 9.8e5Initial program 59.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -8.2e+14)
(fma 3.13060547623 y x)
(if (<= z 980000.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 <= -8.2e+14) {
tmp = fma(3.13060547623, y, x);
} else if (z <= 980000.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 <= -8.2e+14) tmp = fma(3.13060547623, y, x); elseif (z <= 980000.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, -8.2e+14], N[(3.13060547623 * y + x), $MachinePrecision], If[LessEqual[z, 980000.0], N[(N[(1.6453555072203998 * b), $MachinePrecision] * y + x), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\mathbf{elif}\;z \leq 980000:\\
\;\;\;\;\mathsf{fma}\left(1.6453555072203998 \cdot b, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\end{array}
\end{array}
if z < -8.2e14 or 9.8e5 < z Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
if -8.2e14 < z < 9.8e5Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around 0
lower-*.f6460.7
Applied rewrites60.7%
(FPCore (x y z t a b)
:precision binary64
(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 (/ b (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 ((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((b / 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 (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(Float64(b / 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[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[(N[(b / N[(11.9400905721 * z + 0.607771387771), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\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(\frac{b}{\mathsf{fma}\left(11.9400905721, z, 0.607771387771\right)}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\
\end{array}
\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 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around 0
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 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
(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]
\begin{array}{l}
\\
\mathsf{fma}\left(3.13060547623, y, x\right)
\end{array}
Initial program 59.2%
Taylor expanded in z around 0
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites65.6%
Taylor expanded in z around inf
Applied rewrites62.4%
herbie shell --seed 2025159
(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))))