Average Error: 0.4 → 0.4
Time: 2.8s
Precision: binary64
\[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
\[\begin{array}{l} t_0 := 3 \cdot \sqrt{x}\\ y \cdot t_0 + \mathsf{fma}\left(-3, \sqrt{x}, {t_0}^{-1}\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 3.0 (sqrt x))))
   (+ (* y t_0) (fma -3.0 (sqrt x) (pow t_0 -1.0)))))
double code(double x, double y) {
	return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
double code(double x, double y) {
	double t_0 = 3.0 * sqrt(x);
	return (y * t_0) + fma(-3.0, sqrt(x), pow(t_0, -1.0));
}
function code(x, y)
	return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0))
end
function code(x, y)
	t_0 = Float64(3.0 * sqrt(x))
	return Float64(Float64(y * t_0) + fma(-3.0, sqrt(x), (t_0 ^ -1.0)))
end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := Block[{t$95$0 = N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, N[(N[(y * t$95$0), $MachinePrecision] + N[(-3.0 * N[Sqrt[x], $MachinePrecision] + N[Power[t$95$0, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\begin{array}{l}
t_0 := 3 \cdot \sqrt{x}\\
y \cdot t_0 + \mathsf{fma}\left(-3, \sqrt{x}, {t_0}^{-1}\right)
\end{array}

Error

Target

Original0.4
Target0.4
Herbie0.4
\[3 \cdot \left(y \cdot \sqrt{x} + \left(\frac{1}{x \cdot 9} - 1\right) \cdot \sqrt{x}\right) \]

Derivation

  1. Initial program 0.4

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Applied egg-rr0.4

    \[\leadsto \color{blue}{\left(3 \cdot \sqrt{x}\right) \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{0.1111111111111111}{x} + -1\right)} \]
  3. Applied egg-rr0.4

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot y + \color{blue}{\mathsf{fma}\left(-3, \sqrt{x}, \frac{0.1111111111111111}{x} \cdot \left(3 \cdot \sqrt{x}\right)\right)} \]
  4. Applied egg-rr0.4

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot y + \mathsf{fma}\left(-3, \sqrt{x}, \color{blue}{\frac{\frac{0.3333333333333333 \cdot \sqrt{x}}{\sqrt{x}}}{\sqrt{x}}}\right) \]
  5. Applied egg-rr0.4

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot y + \mathsf{fma}\left(-3, \sqrt{x}, \color{blue}{{\left(\sqrt{x} \cdot 3\right)}^{-1}}\right) \]
  6. Final simplification0.4

    \[\leadsto y \cdot \left(3 \cdot \sqrt{x}\right) + \mathsf{fma}\left(-3, \sqrt{x}, {\left(3 \cdot \sqrt{x}\right)}^{-1}\right) \]

Reproduce

herbie shell --seed 2022210 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x))))

  (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))