?

Average Error: 0.02% → 0.02%
Time: 10.0s
Precision: binary64
Cost: 7488

?

\[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
\[\frac{-1}{\mathsf{fma}\left(x, x \cdot 0.04481 + 0.99229, 1\right)} \cdot \left(-2.30753 + x \cdot -0.27061\right) - x \]
(FPCore (x)
 :precision binary64
 (- (/ (+ 2.30753 (* x 0.27061)) (+ 1.0 (* x (+ 0.99229 (* x 0.04481))))) x))
(FPCore (x)
 :precision binary64
 (-
  (*
   (/ -1.0 (fma x (+ (* x 0.04481) 0.99229) 1.0))
   (+ -2.30753 (* x -0.27061)))
  x))
double code(double x) {
	return ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - x;
}
double code(double x) {
	return ((-1.0 / fma(x, ((x * 0.04481) + 0.99229), 1.0)) * (-2.30753 + (x * -0.27061))) - x;
}
function code(x)
	return Float64(Float64(Float64(2.30753 + Float64(x * 0.27061)) / Float64(1.0 + Float64(x * Float64(0.99229 + Float64(x * 0.04481))))) - x)
end
function code(x)
	return Float64(Float64(Float64(-1.0 / fma(x, Float64(Float64(x * 0.04481) + 0.99229), 1.0)) * Float64(-2.30753 + Float64(x * -0.27061))) - x)
end
code[x_] := N[(N[(N[(2.30753 + N[(x * 0.27061), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(x * N[(0.99229 + N[(x * 0.04481), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
code[x_] := N[(N[(N[(-1.0 / N[(x * N[(N[(x * 0.04481), $MachinePrecision] + 0.99229), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(-2.30753 + N[(x * -0.27061), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x
\frac{-1}{\mathsf{fma}\left(x, x \cdot 0.04481 + 0.99229, 1\right)} \cdot \left(-2.30753 + x \cdot -0.27061\right) - x

Error?

Derivation?

  1. Initial program 0.02

    \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
  2. Applied egg-rr0.02

    \[\leadsto \color{blue}{\frac{-1}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)} \cdot \left(-2.30753 - x \cdot 0.27061\right)} - x \]
  3. Applied egg-rr0.02

    \[\leadsto \frac{-1}{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)} \cdot \left(-2.30753 - x \cdot 0.27061\right) - x \]
  4. Final simplification0.02

    \[\leadsto \frac{-1}{\mathsf{fma}\left(x, x \cdot 0.04481 + 0.99229, 1\right)} \cdot \left(-2.30753 + x \cdot -0.27061\right) - x \]

Alternatives

Alternative 1
Error0.02%
Cost1088
\[\frac{x \cdot 0.27061 + 2.30753}{1 + x \cdot \left(x \cdot 0.04481 + 0.99229\right)} - x \]
Alternative 2
Error1.33%
Cost832
\[\frac{x \cdot 0.27061 + 2.30753}{1 + x \cdot 0.99229} - x \]
Alternative 3
Error1.65%
Cost392
\[\begin{array}{l} \mathbf{if}\;x \leq -3.7:\\ \;\;\;\;-x\\ \mathbf{elif}\;x \leq 1.2:\\ \;\;\;\;2.30753\\ \mathbf{else}:\\ \;\;\;\;-x\\ \end{array} \]
Alternative 4
Error2.08%
Cost192
\[2.30753 - x \]
Alternative 5
Error90.27%
Cost64
\[0.2727126142559131 \]
Alternative 6
Error49.27%
Cost64
\[2.30753 \]

Error

Reproduce?

herbie shell --seed 2023088 
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, C"
  :precision binary64
  (- (/ (+ 2.30753 (* x 0.27061)) (+ 1.0 (* x (+ 0.99229 (* x 0.04481))))) x))