| Alternative 1 | |
|---|---|
| Accuracy | 98.2% |
| Cost | 8073 |
(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)))(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(*
x
(+ 313.399215894 (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))
47.066876606)))
(if (or (<= x -1.7e+38) (not (<= x 1000000000000.0)))
(*
(+ x -2.0)
(-
(/ -101.7851458539211 x)
(+
(/ (- 124074.40615218398 y) (pow x 3.0))
(- -4.16438922228 (/ (/ 3451.550173699799 x) x)))))
(*
(+ x -2.0)
(-
(/ (* x y) t_0)
(-
(/
(*
(pow x 2.0)
(+ (* x (+ (* x -4.16438922228) -78.6994924154)) -137.519416416))
t_0)
(/ z t_0)))))))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);
}
double code(double x, double y, double z) {
double t_0 = (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))) + 47.066876606;
double tmp;
if ((x <= -1.7e+38) || !(x <= 1000000000000.0)) {
tmp = (x + -2.0) * ((-101.7851458539211 / x) - (((124074.40615218398 - y) / pow(x, 3.0)) + (-4.16438922228 - ((3451.550173699799 / x) / x))));
} else {
tmp = (x + -2.0) * (((x * y) / t_0) - (((pow(x, 2.0) * ((x * ((x * -4.16438922228) + -78.6994924154)) + -137.519416416)) / t_0) - (z / t_0)));
}
return tmp;
}
real(8) function code(x, y, z)
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
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0)))))) + 47.066876606d0
if ((x <= (-1.7d+38)) .or. (.not. (x <= 1000000000000.0d0))) then
tmp = (x + (-2.0d0)) * (((-101.7851458539211d0) / x) - (((124074.40615218398d0 - y) / (x ** 3.0d0)) + ((-4.16438922228d0) - ((3451.550173699799d0 / x) / x))))
else
tmp = (x + (-2.0d0)) * (((x * y) / t_0) - ((((x ** 2.0d0) * ((x * ((x * (-4.16438922228d0)) + (-78.6994924154d0))) + (-137.519416416d0))) / t_0) - (z / t_0)))
end if
code = tmp
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);
}
public static double code(double x, double y, double z) {
double t_0 = (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))) + 47.066876606;
double tmp;
if ((x <= -1.7e+38) || !(x <= 1000000000000.0)) {
tmp = (x + -2.0) * ((-101.7851458539211 / x) - (((124074.40615218398 - y) / Math.pow(x, 3.0)) + (-4.16438922228 - ((3451.550173699799 / x) / x))));
} else {
tmp = (x + -2.0) * (((x * y) / t_0) - (((Math.pow(x, 2.0) * ((x * ((x * -4.16438922228) + -78.6994924154)) + -137.519416416)) / t_0) - (z / t_0)));
}
return tmp;
}
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)
def code(x, y, z): t_0 = (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))) + 47.066876606 tmp = 0 if (x <= -1.7e+38) or not (x <= 1000000000000.0): tmp = (x + -2.0) * ((-101.7851458539211 / x) - (((124074.40615218398 - y) / math.pow(x, 3.0)) + (-4.16438922228 - ((3451.550173699799 / x) / x)))) else: tmp = (x + -2.0) * (((x * y) / t_0) - (((math.pow(x, 2.0) * ((x * ((x * -4.16438922228) + -78.6994924154)) + -137.519416416)) / t_0) - (z / t_0))) return tmp
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 code(x, y, z) t_0 = Float64(Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))) + 47.066876606) tmp = 0.0 if ((x <= -1.7e+38) || !(x <= 1000000000000.0)) tmp = Float64(Float64(x + -2.0) * Float64(Float64(-101.7851458539211 / x) - Float64(Float64(Float64(124074.40615218398 - y) / (x ^ 3.0)) + Float64(-4.16438922228 - Float64(Float64(3451.550173699799 / x) / x))))); else tmp = Float64(Float64(x + -2.0) * Float64(Float64(Float64(x * y) / t_0) - Float64(Float64(Float64((x ^ 2.0) * Float64(Float64(x * Float64(Float64(x * -4.16438922228) + -78.6994924154)) + -137.519416416)) / t_0) - Float64(z / t_0)))); end return tmp 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
function tmp_2 = code(x, y, z) t_0 = (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))) + 47.066876606; tmp = 0.0; if ((x <= -1.7e+38) || ~((x <= 1000000000000.0))) tmp = (x + -2.0) * ((-101.7851458539211 / x) - (((124074.40615218398 - y) / (x ^ 3.0)) + (-4.16438922228 - ((3451.550173699799 / x) / x)))); else tmp = (x + -2.0) * (((x * y) / t_0) - ((((x ^ 2.0) * ((x * ((x * -4.16438922228) + -78.6994924154)) + -137.519416416)) / t_0) - (z / t_0))); end tmp_2 = tmp; 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]
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]}, If[Or[LessEqual[x, -1.7e+38], N[Not[LessEqual[x, 1000000000000.0]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(-101.7851458539211 / x), $MachinePrecision] - N[(N[(N[(124074.40615218398 - y), $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(-4.16438922228 - N[(N[(3451.550173699799 / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(N[(x * y), $MachinePrecision] / t$95$0), $MachinePrecision] - N[(N[(N[(N[Power[x, 2.0], $MachinePrecision] * N[(N[(x * N[(N[(x * -4.16438922228), $MachinePrecision] + -78.6994924154), $MachinePrecision]), $MachinePrecision] + -137.519416416), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] - N[(z / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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}
\begin{array}{l}
t_0 := x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right) + 47.066876606\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+38} \lor \neg \left(x \leq 1000000000000\right):\\
\;\;\;\;\left(x + -2\right) \cdot \left(\frac{-101.7851458539211}{x} - \left(\frac{124074.40615218398 - y}{{x}^{3}} + \left(-4.16438922228 - \frac{\frac{3451.550173699799}{x}}{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(\frac{x \cdot y}{t_0} - \left(\frac{{x}^{2} \cdot \left(x \cdot \left(x \cdot -4.16438922228 + -78.6994924154\right) + -137.519416416\right)}{t_0} - \frac{z}{t_0}\right)\right)\\
\end{array}
Results
| Original | 58.2% |
|---|---|
| Target | 98.8% |
| Herbie | 98.2% |
if x < -1.69999999999999998e38 or 1e12 < x Initial program 9.8%
Simplified16.7%
[Start]9.8 | \[ \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}
\] |
|---|---|
associate-*r/ [<=]16.7 | \[ \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}}
\] |
sub-neg [=>]16.7 | \[ \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
metadata-eval [=>]16.7 | \[ \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]16.7 | \[ \left(x + -2\right) \cdot \frac{\color{blue}{x \cdot \left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right)} + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]16.7 | \[ \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(x, \left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]16.7 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \color{blue}{x \cdot \left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right)} + y, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]16.7 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, \left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, y\right)}, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]16.7 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right)} + 137.519416416, y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]16.7 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, x \cdot 4.16438922228 + 78.6994924154, 137.519416416\right)}, y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]16.7 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, 137.519416416\right), y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]16.7 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\color{blue}{x \cdot \left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right)} + 47.066876606}
\] |
Taylor expanded in x around -inf 96.6%
Simplified96.6%
[Start]96.6 | \[ \left(x + -2\right) \cdot \left(\left(-1 \cdot \frac{124074.40615218398 + -1 \cdot y}{{x}^{3}} + \left(4.16438922228 + 3451.550173699799 \cdot \frac{1}{{x}^{2}}\right)\right) - 101.7851458539211 \cdot \frac{1}{x}\right)
\] |
|---|---|
cancel-sign-sub-inv [=>]96.6 | \[ \left(x + -2\right) \cdot \color{blue}{\left(\left(-1 \cdot \frac{124074.40615218398 + -1 \cdot y}{{x}^{3}} + \left(4.16438922228 + 3451.550173699799 \cdot \frac{1}{{x}^{2}}\right)\right) + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)}
\] |
+-commutative [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\color{blue}{\left(\left(4.16438922228 + 3451.550173699799 \cdot \frac{1}{{x}^{2}}\right) + -1 \cdot \frac{124074.40615218398 + -1 \cdot y}{{x}^{3}}\right)} + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
mul-1-neg [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + 3451.550173699799 \cdot \frac{1}{{x}^{2}}\right) + \color{blue}{\left(-\frac{124074.40615218398 + -1 \cdot y}{{x}^{3}}\right)}\right) + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
unsub-neg [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\color{blue}{\left(\left(4.16438922228 + 3451.550173699799 \cdot \frac{1}{{x}^{2}}\right) - \frac{124074.40615218398 + -1 \cdot y}{{x}^{3}}\right)} + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
associate-*r/ [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \color{blue}{\frac{3451.550173699799 \cdot 1}{{x}^{2}}}\right) - \frac{124074.40615218398 + -1 \cdot y}{{x}^{3}}\right) + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
metadata-eval [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \frac{\color{blue}{3451.550173699799}}{{x}^{2}}\right) - \frac{124074.40615218398 + -1 \cdot y}{{x}^{3}}\right) + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
unpow2 [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \frac{3451.550173699799}{\color{blue}{x \cdot x}}\right) - \frac{124074.40615218398 + -1 \cdot y}{{x}^{3}}\right) + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
associate-/r* [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \color{blue}{\frac{\frac{3451.550173699799}{x}}{x}}\right) - \frac{124074.40615218398 + -1 \cdot y}{{x}^{3}}\right) + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
mul-1-neg [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \frac{\frac{3451.550173699799}{x}}{x}\right) - \frac{124074.40615218398 + \color{blue}{\left(-y\right)}}{{x}^{3}}\right) + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
unsub-neg [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \frac{\frac{3451.550173699799}{x}}{x}\right) - \frac{\color{blue}{124074.40615218398 - y}}{{x}^{3}}\right) + \left(-101.7851458539211\right) \cdot \frac{1}{x}\right)
\] |
associate-*r/ [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \frac{\frac{3451.550173699799}{x}}{x}\right) - \frac{124074.40615218398 - y}{{x}^{3}}\right) + \color{blue}{\frac{\left(-101.7851458539211\right) \cdot 1}{x}}\right)
\] |
metadata-eval [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \frac{\frac{3451.550173699799}{x}}{x}\right) - \frac{124074.40615218398 - y}{{x}^{3}}\right) + \frac{\color{blue}{-101.7851458539211} \cdot 1}{x}\right)
\] |
metadata-eval [=>]96.6 | \[ \left(x + -2\right) \cdot \left(\left(\left(4.16438922228 + \frac{\frac{3451.550173699799}{x}}{x}\right) - \frac{124074.40615218398 - y}{{x}^{3}}\right) + \frac{\color{blue}{-101.7851458539211}}{x}\right)
\] |
if -1.69999999999999998e38 < x < 1e12Initial program 99.0%
Simplified99.5%
[Start]99.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}
\] |
|---|---|
associate-*r/ [<=]99.5 | \[ \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}}
\] |
sub-neg [=>]99.5 | \[ \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
metadata-eval [=>]99.5 | \[ \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]99.5 | \[ \left(x + -2\right) \cdot \frac{\color{blue}{x \cdot \left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right)} + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]99.5 | \[ \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(x, \left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]99.5 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \color{blue}{x \cdot \left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right)} + y, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]99.5 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, \left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, y\right)}, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]99.5 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right)} + 137.519416416, y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]99.5 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, x \cdot 4.16438922228 + 78.6994924154, 137.519416416\right)}, y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]99.5 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, 137.519416416\right), y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]99.5 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\color{blue}{x \cdot \left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right)} + 47.066876606}
\] |
Taylor expanded in y around 0 99.5%
Final simplification98.2%
| Alternative 1 | |
|---|---|
| Accuracy | 98.2% |
| Cost | 8073 |
| Alternative 2 | |
|---|---|
| Accuracy | 98.3% |
| Cost | 7241 |
| Alternative 3 | |
|---|---|
| Accuracy | 97.9% |
| Cost | 3657 |
| Alternative 4 | |
|---|---|
| Accuracy | 96.9% |
| Cost | 2633 |
| Alternative 5 | |
|---|---|
| Accuracy | 94.3% |
| Cost | 2120 |
| Alternative 6 | |
|---|---|
| Accuracy | 91.3% |
| Cost | 1996 |
| Alternative 7 | |
|---|---|
| Accuracy | 74.7% |
| Cost | 1616 |
| Alternative 8 | |
|---|---|
| Accuracy | 74.6% |
| Cost | 1360 |
| Alternative 9 | |
|---|---|
| Accuracy | 74.7% |
| Cost | 1360 |
| Alternative 10 | |
|---|---|
| Accuracy | 74.6% |
| Cost | 1360 |
| Alternative 11 | |
|---|---|
| Accuracy | 90.1% |
| Cost | 1353 |
| Alternative 12 | |
|---|---|
| Accuracy | 90.1% |
| Cost | 1353 |
| Alternative 13 | |
|---|---|
| Accuracy | 74.3% |
| Cost | 1104 |
| Alternative 14 | |
|---|---|
| Accuracy | 74.2% |
| Cost | 1104 |
| Alternative 15 | |
|---|---|
| Accuracy | 74.5% |
| Cost | 1104 |
| Alternative 16 | |
|---|---|
| Accuracy | 74.2% |
| Cost | 848 |
| Alternative 17 | |
|---|---|
| Accuracy | 74.3% |
| Cost | 848 |
| Alternative 18 | |
|---|---|
| Accuracy | 74.3% |
| Cost | 848 |
| Alternative 19 | |
|---|---|
| Accuracy | 75.3% |
| Cost | 716 |
| Alternative 20 | |
|---|---|
| Accuracy | 76.4% |
| Cost | 456 |
| Alternative 21 | |
|---|---|
| Accuracy | 44.9% |
| Cost | 192 |
herbie shell --seed 2023141
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< x -3.326128725870005e+62) (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811) (if (< x 9.429991714554673e+55) (* (/ (- x 2.0) 1.0) (/ (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z) (+ (* (+ (+ (* 263.505074721 x) (+ (* 43.3400022514 (* x x)) (* x (* x x)))) 313.399215894) x) 47.066876606))) (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811)))
(/ (* (- 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)))