?

Average Error: 0.1 → 0.2
Time: 1.2min
Precision: binary64
Cost: 6976

?

\[1 - x \cdot \left(0.253 + x \cdot 0.12\right) \]
\[1 - \left(\mathsf{fma}\left(x, 0.4743083003952569, 1\right) \cdot x\right) \cdot 0.253 \]
(FPCore (x) :precision binary64 (- 1.0 (* x (+ 0.253 (* x 0.12)))))
(FPCore (x)
 :precision binary64
 (- 1.0 (* (* (fma x 0.4743083003952569 1.0) x) 0.253)))
double code(double x) {
	return 1.0 - (x * (0.253 + (x * 0.12)));
}
double code(double x) {
	return 1.0 - ((fma(x, 0.4743083003952569, 1.0) * x) * 0.253);
}
function code(x)
	return Float64(1.0 - Float64(x * Float64(0.253 + Float64(x * 0.12))))
end
function code(x)
	return Float64(1.0 - Float64(Float64(fma(x, 0.4743083003952569, 1.0) * x) * 0.253))
end
code[x_] := N[(1.0 - N[(x * N[(0.253 + N[(x * 0.12), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := N[(1.0 - N[(N[(N[(x * 0.4743083003952569 + 1.0), $MachinePrecision] * x), $MachinePrecision] * 0.253), $MachinePrecision]), $MachinePrecision]
1 - x \cdot \left(0.253 + x \cdot 0.12\right)
1 - \left(\mathsf{fma}\left(x, 0.4743083003952569, 1\right) \cdot x\right) \cdot 0.253

Error?

Derivation?

  1. Initial program 0.1

    \[1 - x \cdot \left(0.253 + x \cdot 0.12\right) \]
  2. Applied egg-rr0.2

    \[\leadsto 1 - \color{blue}{\left(\mathsf{fma}\left(x, 0.4743083003952569, 1\right) \cdot x\right) \cdot 0.253} \]

Alternatives

Alternative 1
Error0.1
Cost704
\[1 - x \cdot \left(\frac{x \cdot 0.4743083003952569}{3.952569169960474} + 0.253\right) \]
Alternative 2
Error0.1
Cost576
\[1 - x \cdot \left(0.253 + x \cdot 0.12\right) \]
Alternative 3
Error1.9
Cost448
\[1 - \left(x \cdot 0.12\right) \cdot x \]
Alternative 4
Error20.7
Cost320
\[1 - x \cdot 0.253 \]
Alternative 5
Error21.8
Cost64
\[1 \]

Error

Reproduce?

herbie shell --seed 2023033 
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (- 1.0 (* x (+ 0.253 (* x 0.12)))))