Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B

Percentage Accurate: 99.4% → 99.5%
Time: 9.6s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
double code(double x, double y) {
	return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
public static double code(double x, double y) {
	return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
def code(x, y):
	return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.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 tmp = code(x, y)
	tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.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]
\begin{array}{l}

\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
double code(double x, double y) {
	return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
public static double code(double x, double y) {
	return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
def code(x, y):
	return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.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 tmp = code(x, y)
	tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.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]
\begin{array}{l}

\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}

Alternative 1: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt{x \cdot 9} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) + -1\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (sqrt (* x 9.0)) (+ (+ y (/ 1.0 (* x 9.0))) -1.0)))
double code(double x, double y) {
	return sqrt((x * 9.0)) * ((y + (1.0 / (x * 9.0))) + -1.0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sqrt((x * 9.0d0)) * ((y + (1.0d0 / (x * 9.0d0))) + (-1.0d0))
end function
public static double code(double x, double y) {
	return Math.sqrt((x * 9.0)) * ((y + (1.0 / (x * 9.0))) + -1.0);
}
def code(x, y):
	return math.sqrt((x * 9.0)) * ((y + (1.0 / (x * 9.0))) + -1.0)
function code(x, y)
	return Float64(sqrt(Float64(x * 9.0)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) + -1.0))
end
function tmp = code(x, y)
	tmp = sqrt((x * 9.0)) * ((y + (1.0 / (x * 9.0))) + -1.0);
end
code[x_, y_] := N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt{x \cdot 9} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) + -1\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. expm1-log1p-u96.2%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \sqrt{x}\right)\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. expm1-udef51.4%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \sqrt{x}\right)} - 1\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    3. *-commutative51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{x} \cdot 3}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    4. metadata-eval51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    5. sqrt-prod51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{x \cdot 9}}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  4. Applied egg-rr51.4%

    \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)} - 1\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  5. Step-by-step derivation
    1. expm1-def96.3%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. expm1-log1p99.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  6. Simplified99.6%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  7. Final simplification99.6%

    \[\leadsto \sqrt{x \cdot 9} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) + -1\right) \]
  8. Add Preprocessing

Alternative 2: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \left(y - 1\right)\right)\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (* 3.0 (* (sqrt x) (+ (/ 0.1111111111111111 x) (- y 1.0)))))
double code(double x, double y) {
	return 3.0 * (sqrt(x) * ((0.1111111111111111 / x) + (y - 1.0)));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 3.0d0 * (sqrt(x) * ((0.1111111111111111d0 / x) + (y - 1.0d0)))
end function
public static double code(double x, double y) {
	return 3.0 * (Math.sqrt(x) * ((0.1111111111111111 / x) + (y - 1.0)));
}
def code(x, y):
	return 3.0 * (math.sqrt(x) * ((0.1111111111111111 / x) + (y - 1.0)))
function code(x, y)
	return Float64(3.0 * Float64(sqrt(x) * Float64(Float64(0.1111111111111111 / x) + Float64(y - 1.0))))
end
function tmp = code(x, y)
	tmp = 3.0 * (sqrt(x) * ((0.1111111111111111 / x) + (y - 1.0)));
end
code[x_, y_] := N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \left(y - 1\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. expm1-log1p-u96.2%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \sqrt{x}\right)\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. expm1-udef51.4%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \sqrt{x}\right)} - 1\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    3. *-commutative51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{x} \cdot 3}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    4. metadata-eval51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    5. sqrt-prod51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{x \cdot 9}}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  4. Applied egg-rr51.4%

    \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)} - 1\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  5. Step-by-step derivation
    1. expm1-def96.3%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. expm1-log1p99.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  6. Simplified99.6%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  7. Taylor expanded in y around 0 99.1%

    \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right) + 3 \cdot \left(\sqrt{x} \cdot \left(0.1111111111111111 \cdot \frac{1}{x} - 1\right)\right)} \]
  8. Step-by-step derivation
    1. distribute-lft-out99.1%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(0.1111111111111111 \cdot \frac{1}{x} - 1\right)\right)} \]
    2. sub-neg99.1%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \color{blue}{\left(0.1111111111111111 \cdot \frac{1}{x} + \left(-1\right)\right)}\right) \]
    3. associate-*r/99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\color{blue}{\frac{0.1111111111111111 \cdot 1}{x}} + \left(-1\right)\right)\right) \]
    4. metadata-eval99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\frac{\color{blue}{0.1111111111111111}}{x} + \left(-1\right)\right)\right) \]
    5. metadata-eval99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \color{blue}{-1}\right)\right) \]
    6. distribute-lft-in99.5%

      \[\leadsto 3 \cdot \color{blue}{\left(\sqrt{x} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)\right)} \]
    7. +-commutative99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot \color{blue}{\left(\left(\frac{0.1111111111111111}{x} + -1\right) + y\right)}\right) \]
    8. associate-+l+99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot \color{blue}{\left(\frac{0.1111111111111111}{x} + \left(-1 + y\right)\right)}\right) \]
  9. Simplified99.5%

    \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \left(-1 + y\right)\right)\right)} \]
  10. Final simplification99.5%

    \[\leadsto 3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \left(y - 1\right)\right)\right) \]
  11. Add Preprocessing

Alternative 3: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt{x \cdot 9} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (sqrt (* x 9.0)) (+ y (+ (/ 0.1111111111111111 x) -1.0))))
double code(double x, double y) {
	return sqrt((x * 9.0)) * (y + ((0.1111111111111111 / x) + -1.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sqrt((x * 9.0d0)) * (y + ((0.1111111111111111d0 / x) + (-1.0d0)))
end function
public static double code(double x, double y) {
	return Math.sqrt((x * 9.0)) * (y + ((0.1111111111111111 / x) + -1.0));
}
def code(x, y):
	return math.sqrt((x * 9.0)) * (y + ((0.1111111111111111 / x) + -1.0))
function code(x, y)
	return Float64(sqrt(Float64(x * 9.0)) * Float64(y + Float64(Float64(0.1111111111111111 / x) + -1.0)))
end
function tmp = code(x, y)
	tmp = sqrt((x * 9.0)) * (y + ((0.1111111111111111 / x) + -1.0));
end
code[x_, y_] := N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(y + N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt{x \cdot 9} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.0%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. +-commutative99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\color{blue}{\left(\frac{1}{x \cdot 9} + y\right)} - 1\right)\right) \]
    4. associate--l+99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(y - 1\right)\right)}\right) \]
    5. *-commutative99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{1}{\color{blue}{9 \cdot x}} + \left(y - 1\right)\right)\right) \]
    6. associate-/r*99.1%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\color{blue}{\frac{\frac{1}{9}}{x}} + \left(y - 1\right)\right)\right) \]
    7. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{\color{blue}{0.1111111111111111}}{x} + \left(y - 1\right)\right)\right) \]
    8. sub-neg99.1%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \color{blue}{\left(y + \left(-1\right)\right)}\right)\right) \]
    9. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + \color{blue}{-1}\right)\right)\right) \]
  3. Simplified99.1%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r*99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right) \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)} \]
    2. *-commutative99.4%

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

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \color{blue}{\left(\left(y + -1\right) + \frac{0.1111111111111111}{x}\right)} \]
    4. associate-+r+99.4%

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

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(y + \color{blue}{\left(\frac{0.1111111111111111}{x} + -1\right)}\right) \]
    6. distribute-lft-in99.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)} \]
    7. metadata-eval99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{0.1111111111111111}{x} + \color{blue}{\left(-1\right)}\right) \]
    8. sub-neg99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \color{blue}{\left(\frac{0.1111111111111111}{x} - 1\right)} \]
    9. clear-num99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \left(\color{blue}{\frac{1}{\frac{x}{0.1111111111111111}}} - 1\right) \]
    10. div-inv99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{1}{\color{blue}{x \cdot \frac{1}{0.1111111111111111}}} - 1\right) \]
    11. metadata-eval99.4%

      \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{1}{x \cdot \color{blue}{9}} - 1\right) \]
    12. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{1}{x \cdot 9} - 1\right) \]
    13. metadata-eval99.4%

      \[\leadsto \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right) \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{1}{x \cdot 9} - 1\right) \]
    14. sqrt-prod99.5%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot y + \left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{1}{x \cdot 9} - 1\right) \]
    15. *-commutative99.5%

      \[\leadsto \sqrt{x \cdot 9} \cdot y + \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\frac{1}{x \cdot 9} - 1\right) \]
    16. metadata-eval99.5%

      \[\leadsto \sqrt{x \cdot 9} \cdot y + \left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right) \cdot \left(\frac{1}{x \cdot 9} - 1\right) \]
    17. sqrt-prod99.6%

      \[\leadsto \sqrt{x \cdot 9} \cdot y + \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\frac{1}{x \cdot 9} - 1\right) \]
  6. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9} \cdot y + \sqrt{x \cdot 9} \cdot \left(\frac{0.1111111111111111}{x} + -1\right)} \]
  7. Step-by-step derivation
    1. +-commutative99.5%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9} \cdot \left(\frac{0.1111111111111111}{x} + -1\right) + \sqrt{x \cdot 9} \cdot y} \]
    2. distribute-lft-out99.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9} \cdot \left(\left(\frac{0.1111111111111111}{x} + -1\right) + y\right)} \]
  8. Simplified99.6%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9} \cdot \left(\left(\frac{0.1111111111111111}{x} + -1\right) + y\right)} \]
  9. Final simplification99.6%

    \[\leadsto \sqrt{x \cdot 9} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right) \]
  10. Add Preprocessing

Alternative 4: 62.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \sqrt{x} \cdot \left(y \cdot 3 - 3\right) \end{array} \]
(FPCore (x y) :precision binary64 (* (sqrt x) (- (* y 3.0) 3.0)))
double code(double x, double y) {
	return sqrt(x) * ((y * 3.0) - 3.0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sqrt(x) * ((y * 3.0d0) - 3.0d0)
end function
public static double code(double x, double y) {
	return Math.sqrt(x) * ((y * 3.0) - 3.0);
}
def code(x, y):
	return math.sqrt(x) * ((y * 3.0) - 3.0)
function code(x, y)
	return Float64(sqrt(x) * Float64(Float64(y * 3.0) - 3.0))
end
function tmp = code(x, y)
	tmp = sqrt(x) * ((y * 3.0) - 3.0);
end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt{x} \cdot \left(y \cdot 3 - 3\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.0%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. associate--l+99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
    4. distribute-lft-in99.0%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    5. fma-def99.1%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    6. sub-neg99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
    7. +-commutative99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
    8. distribute-lft-in99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
    9. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    10. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    11. *-commutative99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
    12. associate-/r*99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
    13. associate-*r/99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
    14. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
    15. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
  3. Simplified99.1%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 63.9%

    \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y - 3\right)} \]
  6. Final simplification63.9%

    \[\leadsto \sqrt{x} \cdot \left(y \cdot 3 - 3\right) \]
  7. Add Preprocessing

Alternative 5: 62.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \sqrt{x \cdot 9} \cdot \left(y - 1\right) \end{array} \]
(FPCore (x y) :precision binary64 (* (sqrt (* x 9.0)) (- y 1.0)))
double code(double x, double y) {
	return sqrt((x * 9.0)) * (y - 1.0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sqrt((x * 9.0d0)) * (y - 1.0d0)
end function
public static double code(double x, double y) {
	return Math.sqrt((x * 9.0)) * (y - 1.0);
}
def code(x, y):
	return math.sqrt((x * 9.0)) * (y - 1.0)
function code(x, y)
	return Float64(sqrt(Float64(x * 9.0)) * Float64(y - 1.0))
end
function tmp = code(x, y)
	tmp = sqrt((x * 9.0)) * (y - 1.0);
end
code[x_, y_] := N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt{x \cdot 9} \cdot \left(y - 1\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. expm1-log1p-u96.2%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \sqrt{x}\right)\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. expm1-udef51.4%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \sqrt{x}\right)} - 1\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    3. *-commutative51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{x} \cdot 3}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    4. metadata-eval51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    5. sqrt-prod51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{x \cdot 9}}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  4. Applied egg-rr51.4%

    \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)} - 1\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  5. Step-by-step derivation
    1. expm1-def96.3%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. expm1-log1p99.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  6. Simplified99.6%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  7. Taylor expanded in y around inf 64.4%

    \[\leadsto \sqrt{x \cdot 9} \cdot \left(\color{blue}{y} - 1\right) \]
  8. Final simplification64.4%

    \[\leadsto \sqrt{x \cdot 9} \cdot \left(y - 1\right) \]
  9. Add Preprocessing

Alternative 6: 38.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ 3 \cdot \left(y \cdot \sqrt{x}\right) \end{array} \]
(FPCore (x y) :precision binary64 (* 3.0 (* y (sqrt x))))
double code(double x, double y) {
	return 3.0 * (y * sqrt(x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 3.0d0 * (y * sqrt(x))
end function
public static double code(double x, double y) {
	return 3.0 * (y * Math.sqrt(x));
}
def code(x, y):
	return 3.0 * (y * math.sqrt(x))
function code(x, y)
	return Float64(3.0 * Float64(y * sqrt(x)))
end
function tmp = code(x, y)
	tmp = 3.0 * (y * sqrt(x));
end
code[x_, y_] := N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
3 \cdot \left(y \cdot \sqrt{x}\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.0%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. +-commutative99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\color{blue}{\left(\frac{1}{x \cdot 9} + y\right)} - 1\right)\right) \]
    4. associate--l+99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(y - 1\right)\right)}\right) \]
    5. *-commutative99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{1}{\color{blue}{9 \cdot x}} + \left(y - 1\right)\right)\right) \]
    6. associate-/r*99.1%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\color{blue}{\frac{\frac{1}{9}}{x}} + \left(y - 1\right)\right)\right) \]
    7. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{\color{blue}{0.1111111111111111}}{x} + \left(y - 1\right)\right)\right) \]
    8. sub-neg99.1%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \color{blue}{\left(y + \left(-1\right)\right)}\right)\right) \]
    9. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + \color{blue}{-1}\right)\right)\right) \]
  3. Simplified99.1%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in y around inf 38.6%

    \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]
  6. Final simplification38.6%

    \[\leadsto 3 \cdot \left(y \cdot \sqrt{x}\right) \]
  7. Add Preprocessing

Alternative 7: 38.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ y \cdot \left(3 \cdot \sqrt{x}\right) \end{array} \]
(FPCore (x y) :precision binary64 (* y (* 3.0 (sqrt x))))
double code(double x, double y) {
	return y * (3.0 * sqrt(x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = y * (3.0d0 * sqrt(x))
end function
public static double code(double x, double y) {
	return y * (3.0 * Math.sqrt(x));
}
def code(x, y):
	return y * (3.0 * math.sqrt(x))
function code(x, y)
	return Float64(y * Float64(3.0 * sqrt(x)))
end
function tmp = code(x, y)
	tmp = y * (3.0 * sqrt(x));
end
code[x_, y_] := N[(y * N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot \left(3 \cdot \sqrt{x}\right)
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. expm1-log1p-u96.2%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \sqrt{x}\right)\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. expm1-udef51.4%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \sqrt{x}\right)} - 1\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    3. *-commutative51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{x} \cdot 3}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    4. metadata-eval51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\sqrt{x} \cdot \color{blue}{\sqrt{9}}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    5. sqrt-prod51.4%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{x \cdot 9}}\right)} - 1\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  4. Applied egg-rr51.4%

    \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)} - 1\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  5. Step-by-step derivation
    1. expm1-def96.3%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. expm1-log1p99.6%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  6. Simplified99.6%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  7. Taylor expanded in y around 0 99.1%

    \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right) + 3 \cdot \left(\sqrt{x} \cdot \left(0.1111111111111111 \cdot \frac{1}{x} - 1\right)\right)} \]
  8. Step-by-step derivation
    1. distribute-lft-out99.1%

      \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(0.1111111111111111 \cdot \frac{1}{x} - 1\right)\right)} \]
    2. sub-neg99.1%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \color{blue}{\left(0.1111111111111111 \cdot \frac{1}{x} + \left(-1\right)\right)}\right) \]
    3. associate-*r/99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\color{blue}{\frac{0.1111111111111111 \cdot 1}{x}} + \left(-1\right)\right)\right) \]
    4. metadata-eval99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\frac{\color{blue}{0.1111111111111111}}{x} + \left(-1\right)\right)\right) \]
    5. metadata-eval99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot y + \sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \color{blue}{-1}\right)\right) \]
    6. distribute-lft-in99.5%

      \[\leadsto 3 \cdot \color{blue}{\left(\sqrt{x} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)\right)} \]
    7. +-commutative99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot \color{blue}{\left(\left(\frac{0.1111111111111111}{x} + -1\right) + y\right)}\right) \]
    8. associate-+l+99.5%

      \[\leadsto 3 \cdot \left(\sqrt{x} \cdot \color{blue}{\left(\frac{0.1111111111111111}{x} + \left(-1 + y\right)\right)}\right) \]
  9. Simplified99.5%

    \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \left(-1 + y\right)\right)\right)} \]
  10. Taylor expanded in y around inf 38.6%

    \[\leadsto \color{blue}{3 \cdot \left(\sqrt{x} \cdot y\right)} \]
  11. Step-by-step derivation
    1. associate-*r*38.5%

      \[\leadsto \color{blue}{\left(3 \cdot \sqrt{x}\right) \cdot y} \]
    2. *-commutative38.5%

      \[\leadsto \color{blue}{y \cdot \left(3 \cdot \sqrt{x}\right)} \]
  12. Simplified38.5%

    \[\leadsto \color{blue}{y \cdot \left(3 \cdot \sqrt{x}\right)} \]
  13. Final simplification38.5%

    \[\leadsto y \cdot \left(3 \cdot \sqrt{x}\right) \]
  14. Add Preprocessing

Alternative 8: 26.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ -\sqrt{x \cdot 9} \end{array} \]
(FPCore (x y) :precision binary64 (- (sqrt (* x 9.0))))
double code(double x, double y) {
	return -sqrt((x * 9.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = -sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
	return -Math.sqrt((x * 9.0));
}
def code(x, y):
	return -math.sqrt((x * 9.0))
function code(x, y)
	return Float64(-sqrt(Float64(x * 9.0)))
end
function tmp = code(x, y)
	tmp = -sqrt((x * 9.0));
end
code[x_, y_] := (-N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}

\\
-\sqrt{x \cdot 9}
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.0%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. associate--l+99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
    4. distribute-lft-in99.0%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    5. fma-def99.1%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    6. sub-neg99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
    7. +-commutative99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
    8. distribute-lft-in99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
    9. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    10. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    11. *-commutative99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
    12. associate-/r*99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
    13. associate-*r/99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
    14. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
    15. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
  3. Simplified99.1%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 63.9%

    \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y - 3\right)} \]
  6. Taylor expanded in y around 0 27.8%

    \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
  7. Step-by-step derivation
    1. *-commutative27.8%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  8. Simplified27.8%

    \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  9. Step-by-step derivation
    1. *-commutative27.8%

      \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
    2. metadata-eval27.8%

      \[\leadsto \color{blue}{\left(-1 \cdot 3\right)} \cdot \sqrt{x} \]
    3. associate-*r*27.8%

      \[\leadsto \color{blue}{-1 \cdot \left(3 \cdot \sqrt{x}\right)} \]
    4. mul-1-neg27.8%

      \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
    5. *-commutative27.8%

      \[\leadsto -\color{blue}{\sqrt{x} \cdot 3} \]
    6. metadata-eval27.8%

      \[\leadsto -\sqrt{x} \cdot \color{blue}{\sqrt{9}} \]
    7. sqrt-prod27.8%

      \[\leadsto -\color{blue}{\sqrt{x \cdot 9}} \]
  10. Applied egg-rr27.8%

    \[\leadsto \color{blue}{-\sqrt{x \cdot 9}} \]
  11. Final simplification27.8%

    \[\leadsto -\sqrt{x \cdot 9} \]
  12. Add Preprocessing

Alternative 9: 3.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \sqrt{x \cdot 9} \end{array} \]
(FPCore (x y) :precision binary64 (sqrt (* x 9.0)))
double code(double x, double y) {
	return sqrt((x * 9.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
	return Math.sqrt((x * 9.0));
}
def code(x, y):
	return math.sqrt((x * 9.0))
function code(x, y)
	return sqrt(Float64(x * 9.0))
end
function tmp = code(x, y)
	tmp = sqrt((x * 9.0));
end
code[x_, y_] := N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{x \cdot 9}
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.0%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. associate--l+99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
    4. distribute-lft-in99.0%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    5. fma-def99.1%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    6. sub-neg99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
    7. +-commutative99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
    8. distribute-lft-in99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
    9. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    10. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    11. *-commutative99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
    12. associate-/r*99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
    13. associate-*r/99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
    14. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
    15. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
  3. Simplified99.1%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 63.9%

    \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y - 3\right)} \]
  6. Taylor expanded in y around 0 27.8%

    \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
  7. Step-by-step derivation
    1. *-commutative27.8%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  8. Simplified27.8%

    \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  9. Step-by-step derivation
    1. expm1-log1p-u1.0%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{x} \cdot -3\right)\right)} \]
    2. expm1-udef1.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{x} \cdot -3\right)} - 1} \]
    3. add-sqr-sqrt0.0%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\sqrt{x} \cdot -3} \cdot \sqrt{\sqrt{x} \cdot -3}}\right)} - 1 \]
    4. sqrt-unprod2.5%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\left(\sqrt{x} \cdot -3\right) \cdot \left(\sqrt{x} \cdot -3\right)}}\right)} - 1 \]
    5. swap-sqr2.5%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right) \cdot \left(-3 \cdot -3\right)}}\right)} - 1 \]
    6. add-sqr-sqrt2.5%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{x} \cdot \left(-3 \cdot -3\right)}\right)} - 1 \]
    7. metadata-eval2.5%

      \[\leadsto e^{\mathsf{log1p}\left(\sqrt{x \cdot \color{blue}{9}}\right)} - 1 \]
  10. Applied egg-rr2.5%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)} - 1} \]
  11. Step-by-step derivation
    1. expm1-def3.2%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{x \cdot 9}\right)\right)} \]
    2. expm1-log1p3.2%

      \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \]
  12. Simplified3.2%

    \[\leadsto \color{blue}{\sqrt{x \cdot 9}} \]
  13. Final simplification3.2%

    \[\leadsto \sqrt{x \cdot 9} \]
  14. Add Preprocessing

Alternative 10: 26.2% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \sqrt{x} \cdot -3 \end{array} \]
(FPCore (x y) :precision binary64 (* (sqrt x) -3.0))
double code(double x, double y) {
	return sqrt(x) * -3.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sqrt(x) * (-3.0d0)
end function
public static double code(double x, double y) {
	return Math.sqrt(x) * -3.0;
}
def code(x, y):
	return math.sqrt(x) * -3.0
function code(x, y)
	return Float64(sqrt(x) * -3.0)
end
function tmp = code(x, y)
	tmp = sqrt(x) * -3.0;
end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]
\begin{array}{l}

\\
\sqrt{x} \cdot -3
\end{array}
Derivation
  1. Initial program 99.4%

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Step-by-step derivation
    1. *-commutative99.4%

      \[\leadsto \color{blue}{\left(\sqrt{x} \cdot 3\right)} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
    2. associate-*l*99.0%

      \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\right)} \]
    3. associate--l+99.0%

      \[\leadsto \sqrt{x} \cdot \left(3 \cdot \color{blue}{\left(y + \left(\frac{1}{x \cdot 9} - 1\right)\right)}\right) \]
    4. distribute-lft-in99.0%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y + 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    5. fma-def99.1%

      \[\leadsto \sqrt{x} \cdot \color{blue}{\mathsf{fma}\left(3, y, 3 \cdot \left(\frac{1}{x \cdot 9} - 1\right)\right)} \]
    6. sub-neg99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\frac{1}{x \cdot 9} + \left(-1\right)\right)}\right) \]
    7. +-commutative99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{\left(\left(-1\right) + \frac{1}{x \cdot 9}\right)}\right) \]
    8. distribute-lft-in99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{3 \cdot \left(-1\right) + 3 \cdot \frac{1}{x \cdot 9}}\right) \]
    9. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, 3 \cdot \color{blue}{-1} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    10. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, \color{blue}{-3} + 3 \cdot \frac{1}{x \cdot 9}\right) \]
    11. *-commutative99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \frac{1}{\color{blue}{9 \cdot x}}\right) \]
    12. associate-/r*99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + 3 \cdot \color{blue}{\frac{\frac{1}{9}}{x}}\right) \]
    13. associate-*r/99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \color{blue}{\frac{3 \cdot \frac{1}{9}}{x}}\right) \]
    14. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{3 \cdot \color{blue}{0.1111111111111111}}{x}\right) \]
    15. metadata-eval99.1%

      \[\leadsto \sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{\color{blue}{0.3333333333333333}}{x}\right) \]
  3. Simplified99.1%

    \[\leadsto \color{blue}{\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 63.9%

    \[\leadsto \sqrt{x} \cdot \color{blue}{\left(3 \cdot y - 3\right)} \]
  6. Taylor expanded in y around 0 27.8%

    \[\leadsto \color{blue}{-3 \cdot \sqrt{x}} \]
  7. Step-by-step derivation
    1. *-commutative27.8%

      \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  8. Simplified27.8%

    \[\leadsto \color{blue}{\sqrt{x} \cdot -3} \]
  9. Final simplification27.8%

    \[\leadsto \sqrt{x} \cdot -3 \]
  10. Add Preprocessing

Developer target: 99.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ 3 \cdot \left(y \cdot \sqrt{x} + \left(\frac{1}{x \cdot 9} - 1\right) \cdot \sqrt{x}\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x)))))
double code(double x, double y) {
	return 3.0 * ((y * sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * sqrt(x)));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 3.0d0 * ((y * sqrt(x)) + (((1.0d0 / (x * 9.0d0)) - 1.0d0) * sqrt(x)))
end function
public static double code(double x, double y) {
	return 3.0 * ((y * Math.sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * Math.sqrt(x)));
}
def code(x, y):
	return 3.0 * ((y * math.sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * math.sqrt(x)))
function code(x, y)
	return Float64(3.0 * Float64(Float64(y * sqrt(x)) + Float64(Float64(Float64(1.0 / Float64(x * 9.0)) - 1.0) * sqrt(x))))
end
function tmp = code(x, y)
	tmp = 3.0 * ((y * sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * sqrt(x)));
end
code[x_, y_] := N[(3.0 * N[(N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
3 \cdot \left(y \cdot \sqrt{x} + \left(\frac{1}{x \cdot 9} - 1\right) \cdot \sqrt{x}\right)
\end{array}

Reproduce

?
herbie shell --seed 2024033 
(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)))