
(FPCore (x y z)
:precision binary64
(/
(*
(- x 2.0)
(+
(*
(+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y)
x)
z))
(+
(* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x)
47.066876606)))
double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
public static double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
def code(x, y, z): return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
function code(x, y, z) return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) end
function tmp = code(x, y, z) tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(/
(*
(- x 2.0)
(+
(*
(+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y)
x)
z))
(+
(* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x)
47.066876606)))
double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
public static double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
def code(x, y, z): return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
function code(x, y, z) return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) end
function tmp = code(x, y, z) tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606))
(t_1 (/ (- x 2.0) t_0)))
(if (<=
(/
(*
(- x 2.0)
(+
(*
(+
(*
(+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416)
x)
y)
x)
z))
(+
(*
(+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
x)
47.066876606))
1e+293)
(fma
(* (fma (fma (fma 4.16438922228 x 78.6994924154) x 137.519416416) x y) x)
t_1
(/ (* z (- x 2.0)) t_0))
(fma
t_1
z
(*
(-
(+ (+ (/ 3655.1204654076414 (* x x)) 4.16438922228) (/ y (pow x 3.0)))
(fma (pow x -3.0) 130977.50649958357 (/ 110.1139242984811 x)))
x)))))
double code(double x, double y, double z) {
double t_0 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
double t_1 = (x - 2.0) / t_0;
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+293) {
tmp = fma((fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), t_1, ((z * (x - 2.0)) / t_0));
} else {
tmp = fma(t_1, z, (((((3655.1204654076414 / (x * x)) + 4.16438922228) + (y / pow(x, 3.0))) - fma(pow(x, -3.0), 130977.50649958357, (110.1139242984811 / x))) * x));
}
return tmp;
}
function code(x, y, z) t_0 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) t_1 = Float64(Float64(x - 2.0) / t_0) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+293) tmp = fma(Float64(fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), t_1, Float64(Float64(z * Float64(x - 2.0)) / t_0)); else tmp = fma(t_1, z, Float64(Float64(Float64(Float64(Float64(3655.1204654076414 / Float64(x * x)) + 4.16438922228) + Float64(y / (x ^ 3.0))) - fma((x ^ -3.0), 130977.50649958357, Float64(110.1139242984811 / x))) * x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x - 2.0), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision], 1e+293], N[(N[(N[(N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * x + y), $MachinePrecision] * x), $MachinePrecision] * t$95$1 + N[(N[(z * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * z + N[(N[(N[(N[(N[(3655.1204654076414 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 4.16438922228), $MachinePrecision] + N[(y / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[x, -3.0], $MachinePrecision] * 130977.50649958357 + N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
t_1 := \frac{x - 2}{t\_0}\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \leq 10^{+293}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right), x, y\right) \cdot x, t\_1, \frac{z \cdot \left(x - 2\right)}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, \left(\left(\left(\frac{3655.1204654076414}{x \cdot x} + 4.16438922228\right) + \frac{y}{{x}^{3}}\right) - \mathsf{fma}\left({x}^{-3}, 130977.50649958357, \frac{110.1139242984811}{x}\right)\right) \cdot x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 9.9999999999999992e292Initial program 94.9%
Taylor expanded in z around 0
Applied rewrites95.9%
Applied rewrites97.2%
if 9.9999999999999992e292 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 1.6%
Taylor expanded in z around 0
Applied rewrites3.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.2%
Final simplification97.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606))
(t_1 (/ (- x 2.0) t_0)))
(if (<=
(/
(*
(- x 2.0)
(+
(*
(+
(*
(+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416)
x)
y)
x)
z))
(+
(*
(+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
x)
47.066876606))
1e+203)
(fma
(* (fma (fma (fma 4.16438922228 x 78.6994924154) x 137.519416416) x y) x)
t_1
(/ (* z (- x 2.0)) t_0))
(fma t_1 z (* (- 4.16438922228 (/ 110.1139242984811 x)) x)))))
double code(double x, double y, double z) {
double t_0 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
double t_1 = (x - 2.0) / t_0;
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+203) {
tmp = fma((fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), t_1, ((z * (x - 2.0)) / t_0));
} else {
tmp = fma(t_1, z, ((4.16438922228 - (110.1139242984811 / x)) * x));
}
return tmp;
}
function code(x, y, z) t_0 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) t_1 = Float64(Float64(x - 2.0) / t_0) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+203) tmp = fma(Float64(fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), t_1, Float64(Float64(z * Float64(x - 2.0)) / t_0)); else tmp = fma(t_1, z, Float64(Float64(4.16438922228 - Float64(110.1139242984811 / x)) * x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x - 2.0), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision], 1e+203], N[(N[(N[(N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * x + y), $MachinePrecision] * x), $MachinePrecision] * t$95$1 + N[(N[(z * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * z + N[(N[(4.16438922228 - N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
t_1 := \frac{x - 2}{t\_0}\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \leq 10^{+203}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right), x, y\right) \cdot x, t\_1, \frac{z \cdot \left(x - 2\right)}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, \left(4.16438922228 - \frac{110.1139242984811}{x}\right) \cdot x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 9.9999999999999999e202Initial program 94.6%
Taylor expanded in z around 0
Applied rewrites95.6%
Applied rewrites97.0%
if 9.9999999999999999e202 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 13.8%
Taylor expanded in z around 0
Applied rewrites15.6%
Taylor expanded in y around inf
Applied rewrites23.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6496.2
Applied rewrites96.2%
Final simplification96.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606))
(t_1 (/ (- x 2.0) t_0)))
(if (<=
(/
(*
(- x 2.0)
(+
(*
(+
(*
(+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416)
x)
y)
x)
z))
(+
(*
(+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
x)
47.066876606))
1e+203)
(fma
(* (fma (fma (fma 4.16438922228 x 78.6994924154) x 137.519416416) x y) x)
t_1
(/ (* z (- x 2.0)) t_0))
(fma t_1 z (* 4.16438922228 x)))))
double code(double x, double y, double z) {
double t_0 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
double t_1 = (x - 2.0) / t_0;
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+203) {
tmp = fma((fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), t_1, ((z * (x - 2.0)) / t_0));
} else {
tmp = fma(t_1, z, (4.16438922228 * x));
}
return tmp;
}
function code(x, y, z) t_0 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) t_1 = Float64(Float64(x - 2.0) / t_0) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+203) tmp = fma(Float64(fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), t_1, Float64(Float64(z * Float64(x - 2.0)) / t_0)); else tmp = fma(t_1, z, Float64(4.16438922228 * x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x - 2.0), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision], 1e+203], N[(N[(N[(N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * x + y), $MachinePrecision] * x), $MachinePrecision] * t$95$1 + N[(N[(z * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * z + N[(4.16438922228 * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
t_1 := \frac{x - 2}{t\_0}\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \leq 10^{+203}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right), x, y\right) \cdot x, t\_1, \frac{z \cdot \left(x - 2\right)}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, 4.16438922228 \cdot x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 9.9999999999999999e202Initial program 94.6%
Taylor expanded in z around 0
Applied rewrites95.6%
Applied rewrites97.0%
if 9.9999999999999999e202 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 13.8%
Taylor expanded in z around 0
Applied rewrites15.6%
Taylor expanded in x around inf
lower-*.f6496.2
Applied rewrites96.2%
Final simplification96.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606)))
(if (<=
(/
(*
(- x 2.0)
(+
(*
(+
(*
(+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416)
x)
y)
x)
z))
(+
(*
(+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
x)
47.066876606))
1e+305)
(fma
(* (fma (fma (fma 4.16438922228 x 78.6994924154) x 137.519416416) x y) x)
(/ (- x 2.0) t_0)
(/ (* z (- x 2.0)) t_0))
(fma
(/
(- x 2.0)
(*
(fma
(/
(+ (/ (+ (/ 313.399215894 x) 263.505074721) x) 43.3400022514)
(- x))
-1.0
1.0)
(pow x 4.0)))
z
(* 4.16438922228 x)))))
double code(double x, double y, double z) {
double t_0 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+305) {
tmp = fma((fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), ((x - 2.0) / t_0), ((z * (x - 2.0)) / t_0));
} else {
tmp = fma(((x - 2.0) / (fma((((((313.399215894 / x) + 263.505074721) / x) + 43.3400022514) / -x), -1.0, 1.0) * pow(x, 4.0))), z, (4.16438922228 * x));
}
return tmp;
}
function code(x, y, z) t_0 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+305) tmp = fma(Float64(fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), Float64(Float64(x - 2.0) / t_0), Float64(Float64(z * Float64(x - 2.0)) / t_0)); else tmp = fma(Float64(Float64(x - 2.0) / Float64(fma(Float64(Float64(Float64(Float64(Float64(313.399215894 / x) + 263.505074721) / x) + 43.3400022514) / Float64(-x)), -1.0, 1.0) * (x ^ 4.0))), z, Float64(4.16438922228 * x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision], 1e+305], N[(N[(N[(N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * x + y), $MachinePrecision] * x), $MachinePrecision] * N[(N[(x - 2.0), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(z * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - 2.0), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(313.399215894 / x), $MachinePrecision] + 263.505074721), $MachinePrecision] / x), $MachinePrecision] + 43.3400022514), $MachinePrecision] / (-x)), $MachinePrecision] * -1.0 + 1.0), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z + N[(4.16438922228 * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right), x, y\right) \cdot x, \frac{x - 2}{t\_0}, \frac{z \cdot \left(x - 2\right)}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - 2}{\mathsf{fma}\left(\frac{\frac{\frac{313.399215894}{x} + 263.505074721}{x} + 43.3400022514}{-x}, -1, 1\right) \cdot {x}^{4}}, z, 4.16438922228 \cdot x\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 9.9999999999999994e304Initial program 95.0%
Taylor expanded in z around 0
Applied rewrites95.9%
Applied rewrites97.2%
if 9.9999999999999994e304 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.5%
Taylor expanded in z around 0
Applied rewrites2.6%
Taylor expanded in x around inf
lower-*.f6495.7
Applied rewrites95.7%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites95.7%
Final simplification96.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606)))
(if (<=
(/
(*
(- x 2.0)
(+
(*
(+
(*
(+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416)
x)
y)
x)
z))
(+
(*
(+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
x)
47.066876606))
1e+305)
(fma
(* (fma (fma (fma 4.16438922228 x 78.6994924154) x 137.519416416) x y) x)
(/ (- x 2.0) t_0)
(/ (* z (- x 2.0)) t_0))
(*
(-
(+ (+ (/ 3655.1204654076414 (* x x)) 4.16438922228) (/ y (pow x 3.0)))
(fma (pow x -3.0) 130977.50649958357 (/ 110.1139242984811 x)))
x))))
double code(double x, double y, double z) {
double t_0 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
double tmp;
if ((((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+305) {
tmp = fma((fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), ((x - 2.0) / t_0), ((z * (x - 2.0)) / t_0));
} else {
tmp = ((((3655.1204654076414 / (x * x)) + 4.16438922228) + (y / pow(x, 3.0))) - fma(pow(x, -3.0), 130977.50649958357, (110.1139242984811 / x))) * x;
}
return tmp;
}
function code(x, y, z) t_0 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 1e+305) tmp = fma(Float64(fma(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), x, y) * x), Float64(Float64(x - 2.0) / t_0), Float64(Float64(z * Float64(x - 2.0)) / t_0)); else tmp = Float64(Float64(Float64(Float64(Float64(3655.1204654076414 / Float64(x * x)) + 4.16438922228) + Float64(y / (x ^ 3.0))) - fma((x ^ -3.0), 130977.50649958357, Float64(110.1139242984811 / x))) * x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision], 1e+305], N[(N[(N[(N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * x + y), $MachinePrecision] * x), $MachinePrecision] * N[(N[(x - 2.0), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(z * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(3655.1204654076414 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 4.16438922228), $MachinePrecision] + N[(y / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[x, -3.0], $MachinePrecision] * 130977.50649958357 + N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right), x, y\right) \cdot x, \frac{x - 2}{t\_0}, \frac{z \cdot \left(x - 2\right)}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\frac{3655.1204654076414}{x \cdot x} + 4.16438922228\right) + \frac{y}{{x}^{3}}\right) - \mathsf{fma}\left({x}^{-3}, 130977.50649958357, \frac{110.1139242984811}{x}\right)\right) \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 9.9999999999999994e304Initial program 95.0%
Taylor expanded in z around 0
Applied rewrites95.9%
Applied rewrites97.2%
if 9.9999999999999994e304 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites95.0%
Final simplification96.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
(- x 2.0)
(+
(*
(+
(*
(+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416)
x)
y)
x)
z))
(+
(*
(+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
x)
47.066876606)))
(t_1
(fma
(* x x)
(fma (fma 4.16438922228 x 78.6994924154) x 137.519416416)
z))
(t_2
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606)))
(if (<= t_0 (- INFINITY))
(* (fma (/ t_1 y) (/ (- x 2.0) t_2) (/ (* (- x 2.0) x) t_2)) y)
(if (<= t_0 1e+305)
(/ (fma (* (- x 2.0) y) x (* t_1 (- x 2.0))) t_2)
(*
(-
(+ (+ (/ 3655.1204654076414 (* x x)) 4.16438922228) (/ y (pow x 3.0)))
(fma (pow x -3.0) 130977.50649958357 (/ 110.1139242984811 x)))
x)))))
double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double t_1 = fma((x * x), fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), z);
double t_2 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma((t_1 / y), ((x - 2.0) / t_2), (((x - 2.0) * x) / t_2)) * y;
} else if (t_0 <= 1e+305) {
tmp = fma(((x - 2.0) * y), x, (t_1 * (x - 2.0))) / t_2;
} else {
tmp = ((((3655.1204654076414 / (x * x)) + 4.16438922228) + (y / pow(x, 3.0))) - fma(pow(x, -3.0), 130977.50649958357, (110.1139242984811 / x))) * x;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) t_1 = fma(Float64(x * x), fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416), z) t_2 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(Float64(t_1 / y), Float64(Float64(x - 2.0) / t_2), Float64(Float64(Float64(x - 2.0) * x) / t_2)) * y); elseif (t_0 <= 1e+305) tmp = Float64(fma(Float64(Float64(x - 2.0) * y), x, Float64(t_1 * Float64(x - 2.0))) / t_2); else tmp = Float64(Float64(Float64(Float64(Float64(3655.1204654076414 / Float64(x * x)) + 4.16438922228) + Float64(y / (x ^ 3.0))) - fma((x ^ -3.0), 130977.50649958357, Float64(110.1139242984811 / x))) * x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] + z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(t$95$1 / y), $MachinePrecision] * N[(N[(x - 2.0), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(N[(x - 2.0), $MachinePrecision] * x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(N[(N[(N[(x - 2.0), $MachinePrecision] * y), $MachinePrecision] * x + N[(t$95$1 * N[(x - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[(N[(N[(3655.1204654076414 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 4.16438922228), $MachinePrecision] + N[(y / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[x, -3.0], $MachinePrecision] * 130977.50649958357 + N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}\\
t_1 := \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right), z\right)\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_1}{y}, \frac{x - 2}{t\_2}, \frac{\left(x - 2\right) \cdot x}{t\_2}\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(x - 2\right) \cdot y, x, t\_1 \cdot \left(x - 2\right)\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\frac{3655.1204654076414}{x \cdot x} + 4.16438922228\right) + \frac{y}{{x}^{3}}\right) - \mathsf{fma}\left({x}^{-3}, 130977.50649958357, \frac{110.1139242984811}{x}\right)\right) \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < -inf.0Initial program 4.8%
Taylor expanded in y around inf
Applied rewrites87.6%
if -inf.0 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 9.9999999999999994e304Initial program 99.5%
Taylor expanded in y around 0
Applied rewrites99.6%
if 9.9999999999999994e304 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites95.0%
Final simplification97.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
(- x 2.0)
(+
(*
(+
(*
(+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416)
x)
y)
x)
z))
(+
(*
(+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
x)
47.066876606)))
(t_1 (fma (fma 4.16438922228 x 78.6994924154) x 137.519416416))
(t_2
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606)))
(if (<= t_0 (- INFINITY))
(*
(fma (/ (fma (* x x) t_1 z) y) (/ (- x 2.0) t_2) (/ (* (- x 2.0) x) t_2))
y)
(if (<= t_0 1e+305)
(fma
x
(/ (* y (- x 2.0)) t_2)
(/ (fma z (- x 2.0) (* (* t_1 (- x 2.0)) (* x x))) t_2))
(*
(-
(+ (+ (/ 3655.1204654076414 (* x x)) 4.16438922228) (/ y (pow x 3.0)))
(fma (pow x -3.0) 130977.50649958357 (/ 110.1139242984811 x)))
x)))))
double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double t_1 = fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416);
double t_2 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = fma((fma((x * x), t_1, z) / y), ((x - 2.0) / t_2), (((x - 2.0) * x) / t_2)) * y;
} else if (t_0 <= 1e+305) {
tmp = fma(x, ((y * (x - 2.0)) / t_2), (fma(z, (x - 2.0), ((t_1 * (x - 2.0)) * (x * x))) / t_2));
} else {
tmp = ((((3655.1204654076414 / (x * x)) + 4.16438922228) + (y / pow(x, 3.0))) - fma(pow(x, -3.0), 130977.50649958357, (110.1139242984811 / x))) * x;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) t_1 = fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416) t_2 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(fma(Float64(fma(Float64(x * x), t_1, z) / y), Float64(Float64(x - 2.0) / t_2), Float64(Float64(Float64(x - 2.0) * x) / t_2)) * y); elseif (t_0 <= 1e+305) tmp = fma(x, Float64(Float64(y * Float64(x - 2.0)) / t_2), Float64(fma(z, Float64(x - 2.0), Float64(Float64(t_1 * Float64(x - 2.0)) * Float64(x * x))) / t_2)); else tmp = Float64(Float64(Float64(Float64(Float64(3655.1204654076414 / Float64(x * x)) + 4.16438922228) + Float64(y / (x ^ 3.0))) - fma((x ^ -3.0), 130977.50649958357, Float64(110.1139242984811 / x))) * x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * t$95$1 + z), $MachinePrecision] / y), $MachinePrecision] * N[(N[(x - 2.0), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(N[(x - 2.0), $MachinePrecision] * x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(x * N[(N[(y * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(z * N[(x - 2.0), $MachinePrecision] + N[(N[(t$95$1 * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(3655.1204654076414 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 4.16438922228), $MachinePrecision] + N[(y / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[x, -3.0], $MachinePrecision] * 130977.50649958357 + N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}\\
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right)\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(x \cdot x, t\_1, z\right)}{y}, \frac{x - 2}{t\_2}, \frac{\left(x - 2\right) \cdot x}{t\_2}\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y \cdot \left(x - 2\right)}{t\_2}, \frac{\mathsf{fma}\left(z, x - 2, \left(t\_1 \cdot \left(x - 2\right)\right) \cdot \left(x \cdot x\right)\right)}{t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\frac{3655.1204654076414}{x \cdot x} + 4.16438922228\right) + \frac{y}{{x}^{3}}\right) - \mathsf{fma}\left({x}^{-3}, 130977.50649958357, \frac{110.1139242984811}{x}\right)\right) \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < -inf.0Initial program 4.8%
Taylor expanded in y around inf
Applied rewrites87.6%
if -inf.0 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 9.9999999999999994e304Initial program 99.5%
Taylor expanded in z around 0
Applied rewrites99.4%
Taylor expanded in x around inf
lower-*.f6469.7
Applied rewrites69.7%
Taylor expanded in y around 0
Applied rewrites99.6%
if 9.9999999999999994e304 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites95.0%
Final simplification97.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
(- x 2.0)
(+
(*
(+
(*
(+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416)
x)
y)
x)
z))
(+
(*
(+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
x)
47.066876606)))
(t_1
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606)))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 1e+305)))
(*
(-
(+ (+ (/ 3655.1204654076414 (* x x)) 4.16438922228) (/ y (pow x 3.0)))
(fma (pow x -3.0) 130977.50649958357 (/ 110.1139242984811 x)))
x)
(fma
x
(/ (* y (- x 2.0)) t_1)
(/
(fma
z
(- x 2.0)
(*
(*
(fma (fma 4.16438922228 x 78.6994924154) x 137.519416416)
(- x 2.0))
(* x x)))
t_1)))))
double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
double t_1 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 1e+305)) {
tmp = ((((3655.1204654076414 / (x * x)) + 4.16438922228) + (y / pow(x, 3.0))) - fma(pow(x, -3.0), 130977.50649958357, (110.1139242984811 / x))) * x;
} else {
tmp = fma(x, ((y * (x - 2.0)) / t_1), (fma(z, (x - 2.0), ((fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416) * (x - 2.0)) * (x * x))) / t_1));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) t_1 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 1e+305)) tmp = Float64(Float64(Float64(Float64(Float64(3655.1204654076414 / Float64(x * x)) + 4.16438922228) + Float64(y / (x ^ 3.0))) - fma((x ^ -3.0), 130977.50649958357, Float64(110.1139242984811 / x))) * x); else tmp = fma(x, Float64(Float64(y * Float64(x - 2.0)) / t_1), Float64(fma(z, Float64(x - 2.0), Float64(Float64(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416) * Float64(x - 2.0)) * Float64(x * x))) / t_1)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 1e+305]], $MachinePrecision]], N[(N[(N[(N[(N[(3655.1204654076414 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 4.16438922228), $MachinePrecision] + N[(y / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[x, -3.0], $MachinePrecision] * 130977.50649958357 + N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(x * N[(N[(y * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(z * N[(x - 2.0), $MachinePrecision] + N[(N[(N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}\\
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
\mathbf{if}\;t\_0 \leq -\infty \lor \neg \left(t\_0 \leq 10^{+305}\right):\\
\;\;\;\;\left(\left(\left(\frac{3655.1204654076414}{x \cdot x} + 4.16438922228\right) + \frac{y}{{x}^{3}}\right) - \mathsf{fma}\left({x}^{-3}, 130977.50649958357, \frac{110.1139242984811}{x}\right)\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y \cdot \left(x - 2\right)}{t\_1}, \frac{\mathsf{fma}\left(z, x - 2, \left(\mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right) \cdot \left(x - 2\right)\right) \cdot \left(x \cdot x\right)\right)}{t\_1}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < -inf.0 or 9.9999999999999994e304 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.4%
if -inf.0 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 9.9999999999999994e304Initial program 99.5%
Taylor expanded in z around 0
Applied rewrites99.4%
Taylor expanded in x around inf
lower-*.f6469.7
Applied rewrites69.7%
Taylor expanded in y around 0
Applied rewrites99.6%
Final simplification97.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606)))
(fma
x
(/ (* y (- x 2.0)) t_0)
(/
(fma
z
(- x 2.0)
(*
(* (fma (fma 4.16438922228 x 78.6994924154) x 137.519416416) (- x 2.0))
(* x x)))
t_0))))
double code(double x, double y, double z) {
double t_0 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
return fma(x, ((y * (x - 2.0)) / t_0), (fma(z, (x - 2.0), ((fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416) * (x - 2.0)) * (x * x))) / t_0));
}
function code(x, y, z) t_0 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) return fma(x, Float64(Float64(y * Float64(x - 2.0)) / t_0), Float64(fma(z, Float64(x - 2.0), Float64(Float64(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416) * Float64(x - 2.0)) * Float64(x * x))) / t_0)) end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, N[(x * N[(N[(y * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(z * N[(x - 2.0), $MachinePrecision] + N[(N[(N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
\mathsf{fma}\left(x, \frac{y \cdot \left(x - 2\right)}{t\_0}, \frac{\mathsf{fma}\left(z, x - 2, \left(\mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right) \cdot \left(x - 2\right)\right) \cdot \left(x \cdot x\right)\right)}{t\_0}\right)
\end{array}
\end{array}
Initial program 61.8%
Taylor expanded in z around 0
Applied rewrites63.1%
Taylor expanded in x around inf
lower-*.f6478.7
Applied rewrites78.7%
Taylor expanded in y around 0
Applied rewrites61.8%
Final simplification61.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(fma
(fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
x
47.066876606)))
(*
(fma
x
(/ (- x 2.0) t_0)
(/
(/
(fma
z
(- x 2.0)
(*
(*
(fma (fma 4.16438922228 x 78.6994924154) x 137.519416416)
(- x 2.0))
(* x x)))
t_0)
y))
y)))
double code(double x, double y, double z) {
double t_0 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
return fma(x, ((x - 2.0) / t_0), ((fma(z, (x - 2.0), ((fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416) * (x - 2.0)) * (x * x))) / t_0) / y)) * y;
}
function code(x, y, z) t_0 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606) return Float64(fma(x, Float64(Float64(x - 2.0) / t_0), Float64(Float64(fma(z, Float64(x - 2.0), Float64(Float64(fma(fma(4.16438922228, x, 78.6994924154), x, 137.519416416) * Float64(x - 2.0)) * Float64(x * x))) / t_0) / y)) * y) end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, N[(N[(x * N[(N[(x - 2.0), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(N[(z * N[(x - 2.0), $MachinePrecision] + N[(N[(N[(N[(4.16438922228 * x + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
\mathsf{fma}\left(x, \frac{x - 2}{t\_0}, \frac{\frac{\mathsf{fma}\left(z, x - 2, \left(\mathsf{fma}\left(\mathsf{fma}\left(4.16438922228, x, 78.6994924154\right), x, 137.519416416\right) \cdot \left(x - 2\right)\right) \cdot \left(x \cdot x\right)\right)}{t\_0}}{y}\right) \cdot y
\end{array}
\end{array}
Initial program 61.8%
Taylor expanded in z around 0
Applied rewrites63.1%
Taylor expanded in y around -inf
Applied rewrites57.4%
Final simplification57.4%
herbie shell --seed 2025059
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C"
:precision binary64
:alt
(! :herbie-platform default (if (< x -332612872587000500000000000000000000000000000000000000000000000) (- (+ (/ y (* x x)) (* 104109730557/25000000000 x)) 1101139242984811/10000000000000) (if (< x 94299917145546730000000000000000000000000000000000000000) (* (/ (- x 2) 1) (/ (+ (* (+ (* (+ (* (+ (* x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z) (+ (* (+ (+ (* 263505074721/1000000000 x) (+ (* 216700011257/5000000000 (* x x)) (* x (* x x)))) 156699607947/500000000) x) 23533438303/500000000))) (- (+ (/ y (* x x)) (* 104109730557/25000000000 x)) 1101139242984811/10000000000000))))
(/ (* (- x 2.0) (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z)) (+ (* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x) 47.066876606)))