Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, C

Percentage Accurate: 100.0% → 100.0%
Time: 6.9s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \end{array} \]
(FPCore (x)
 :precision binary64
 (- (/ (+ 2.30753 (* x 0.27061)) (+ 1.0 (* x (+ 0.99229 (* x 0.04481))))) x))
double code(double x) {
	return ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - x;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = ((2.30753d0 + (x * 0.27061d0)) / (1.0d0 + (x * (0.99229d0 + (x * 0.04481d0))))) - x
end function
public static double code(double x) {
	return ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - x;
}
def code(x):
	return ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - 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 tmp = code(x)
	tmp = ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - 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]
\begin{array}{l}

\\
\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x
\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 9 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: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \end{array} \]
(FPCore (x)
 :precision binary64
 (- (/ (+ 2.30753 (* x 0.27061)) (+ 1.0 (* x (+ 0.99229 (* x 0.04481))))) x))
double code(double x) {
	return ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - x;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = ((2.30753d0 + (x * 0.27061d0)) / (1.0d0 + (x * (0.99229d0 + (x * 0.04481d0))))) - x
end function
public static double code(double x) {
	return ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - x;
}
def code(x):
	return ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - 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 tmp = code(x)
	tmp = ((2.30753 + (x * 0.27061)) / (1.0 + (x * (0.99229 + (x * 0.04481))))) - 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]
\begin{array}{l}

\\
\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x
\end{array}

Alternative 1: 100.0% accurate, 0.1× speedup?

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

\\
\frac{1}{\frac{\mathsf{fma}\left(x, x \cdot 0.04481 + 0.99229, 1\right)}{x \cdot 0.27061 + 2.30753}} - x
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
  2. Step-by-step derivation
    1. clear-num100.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}}} - x \]
    2. inv-pow100.0%

      \[\leadsto \color{blue}{{\left(\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1}} - x \]
    3. +-commutative100.0%

      \[\leadsto {\left(\frac{\color{blue}{x \cdot \left(0.99229 + x \cdot 0.04481\right) + 1}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
    4. fma-def100.0%

      \[\leadsto {\left(\frac{\color{blue}{\mathsf{fma}\left(x, 0.99229 + x \cdot 0.04481, 1\right)}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
    5. +-commutative100.0%

      \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
    6. fma-def100.0%

      \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.04481, 0.99229\right)}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
    7. +-commutative100.0%

      \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}\right)}^{-1} - x \]
    8. fma-def100.0%

      \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}\right)}^{-1} - x \]
  3. Applied egg-rr100.0%

    \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}\right)}^{-1}} - x \]
  4. Step-by-step derivation
    1. unpow-1100.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}} - x \]
  5. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}} - x \]
  6. Step-by-step derivation
    1. fma-udef100.0%

      \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}} - x \]
  7. Applied egg-rr100.0%

    \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}} - x \]
  8. Step-by-step derivation
    1. fma-udef100.0%

      \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{x \cdot 0.27061 + 2.30753}} - x \]
  9. Applied egg-rr100.0%

    \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{x \cdot 0.27061 + 2.30753}} - x \]
  10. Final simplification100.0%

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

Alternative 2: 99.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.05:\\ \;\;\;\;\left(\frac{6.039053782637804}{x} - \frac{82.23527511657367}{x \cdot x}\right) - x\\ \mathbf{elif}\;x \leq 1.2:\\ \;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(x \cdot 0.16558885480950444 + 2.254864010426164\right) - \frac{15.532191530167717}{x}} - x\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x -1.05)
   (- (- (/ 6.039053782637804 x) (/ 82.23527511657367 (* x x))) x)
   (if (<= x 1.2)
     (+ 2.30753 (* x (+ (* x 1.900161040244073) -3.0191289437)))
     (-
      (/
       1.0
       (-
        (+ (* x 0.16558885480950444) 2.254864010426164)
        (/ 15.532191530167717 x)))
      x))))
double code(double x) {
	double tmp;
	if (x <= -1.05) {
		tmp = ((6.039053782637804 / x) - (82.23527511657367 / (x * x))) - x;
	} else if (x <= 1.2) {
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	} else {
		tmp = (1.0 / (((x * 0.16558885480950444) + 2.254864010426164) - (15.532191530167717 / x))) - x;
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= (-1.05d0)) then
        tmp = ((6.039053782637804d0 / x) - (82.23527511657367d0 / (x * x))) - x
    else if (x <= 1.2d0) then
        tmp = 2.30753d0 + (x * ((x * 1.900161040244073d0) + (-3.0191289437d0)))
    else
        tmp = (1.0d0 / (((x * 0.16558885480950444d0) + 2.254864010426164d0) - (15.532191530167717d0 / x))) - x
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if (x <= -1.05) {
		tmp = ((6.039053782637804 / x) - (82.23527511657367 / (x * x))) - x;
	} else if (x <= 1.2) {
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	} else {
		tmp = (1.0 / (((x * 0.16558885480950444) + 2.254864010426164) - (15.532191530167717 / x))) - x;
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= -1.05:
		tmp = ((6.039053782637804 / x) - (82.23527511657367 / (x * x))) - x
	elif x <= 1.2:
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437))
	else:
		tmp = (1.0 / (((x * 0.16558885480950444) + 2.254864010426164) - (15.532191530167717 / x))) - x
	return tmp
function code(x)
	tmp = 0.0
	if (x <= -1.05)
		tmp = Float64(Float64(Float64(6.039053782637804 / x) - Float64(82.23527511657367 / Float64(x * x))) - x);
	elseif (x <= 1.2)
		tmp = Float64(2.30753 + Float64(x * Float64(Float64(x * 1.900161040244073) + -3.0191289437)));
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(Float64(x * 0.16558885480950444) + 2.254864010426164) - Float64(15.532191530167717 / x))) - x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= -1.05)
		tmp = ((6.039053782637804 / x) - (82.23527511657367 / (x * x))) - x;
	elseif (x <= 1.2)
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	else
		tmp = (1.0 / (((x * 0.16558885480950444) + 2.254864010426164) - (15.532191530167717 / x))) - x;
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, -1.05], N[(N[(N[(6.039053782637804 / x), $MachinePrecision] - N[(82.23527511657367 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 1.2], N[(2.30753 + N[(x * N[(N[(x * 1.900161040244073), $MachinePrecision] + -3.0191289437), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(N[(x * 0.16558885480950444), $MachinePrecision] + 2.254864010426164), $MachinePrecision] - N[(15.532191530167717 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05:\\
\;\;\;\;\left(\frac{6.039053782637804}{x} - \frac{82.23527511657367}{x \cdot x}\right) - x\\

\mathbf{elif}\;x \leq 1.2:\\
\;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(x \cdot 0.16558885480950444 + 2.254864010426164\right) - \frac{15.532191530167717}{x}} - x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.05000000000000004

    1. Initial program 100.0%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Taylor expanded in x around inf 97.9%

      \[\leadsto \color{blue}{\left(6.039053782637804 \cdot \frac{1}{x} - 82.23527511657367 \cdot \frac{1}{{x}^{2}}\right)} - x \]
    3. Step-by-step derivation
      1. associate-*r/97.9%

        \[\leadsto \left(\color{blue}{\frac{6.039053782637804 \cdot 1}{x}} - 82.23527511657367 \cdot \frac{1}{{x}^{2}}\right) - x \]
      2. metadata-eval97.9%

        \[\leadsto \left(\frac{\color{blue}{6.039053782637804}}{x} - 82.23527511657367 \cdot \frac{1}{{x}^{2}}\right) - x \]
      3. unpow297.9%

        \[\leadsto \left(\frac{6.039053782637804}{x} - 82.23527511657367 \cdot \frac{1}{\color{blue}{x \cdot x}}\right) - x \]
      4. associate-*r/97.9%

        \[\leadsto \left(\frac{6.039053782637804}{x} - \color{blue}{\frac{82.23527511657367 \cdot 1}{x \cdot x}}\right) - x \]
      5. metadata-eval97.9%

        \[\leadsto \left(\frac{6.039053782637804}{x} - \frac{\color{blue}{82.23527511657367}}{x \cdot x}\right) - x \]
    4. Simplified97.9%

      \[\leadsto \color{blue}{\left(\frac{6.039053782637804}{x} - \frac{82.23527511657367}{x \cdot x}\right)} - x \]

    if -1.05000000000000004 < x < 1.19999999999999996

    1. Initial program 99.9%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}}} - x \]
      2. inv-pow99.9%

        \[\leadsto \color{blue}{{\left(\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1}} - x \]
      3. +-commutative99.9%

        \[\leadsto {\left(\frac{\color{blue}{x \cdot \left(0.99229 + x \cdot 0.04481\right) + 1}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      4. fma-def99.9%

        \[\leadsto {\left(\frac{\color{blue}{\mathsf{fma}\left(x, 0.99229 + x \cdot 0.04481, 1\right)}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      5. +-commutative99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      6. fma-def99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.04481, 0.99229\right)}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      7. +-commutative99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}\right)}^{-1} - x \]
      8. fma-def99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}\right)}^{-1} - x \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}\right)}^{-1}} - x \]
    4. Taylor expanded in x around 0 99.0%

      \[\leadsto \color{blue}{\left(2.30753 + \left(-2.0191289437 \cdot x + 1.900161040244073 \cdot {x}^{2}\right)\right)} - x \]
    5. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto \left(2.30753 + \color{blue}{\left(1.900161040244073 \cdot {x}^{2} + -2.0191289437 \cdot x\right)}\right) - x \]
      2. unpow299.0%

        \[\leadsto \left(2.30753 + \left(1.900161040244073 \cdot \color{blue}{\left(x \cdot x\right)} + -2.0191289437 \cdot x\right)\right) - x \]
      3. *-commutative99.0%

        \[\leadsto \left(2.30753 + \left(1.900161040244073 \cdot \left(x \cdot x\right) + \color{blue}{x \cdot -2.0191289437}\right)\right) - x \]
      4. fma-def99.0%

        \[\leadsto \left(2.30753 + \color{blue}{\mathsf{fma}\left(1.900161040244073, x \cdot x, x \cdot -2.0191289437\right)}\right) - x \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{\left(2.30753 + \mathsf{fma}\left(1.900161040244073, x \cdot x, x \cdot -2.0191289437\right)\right)} - x \]
    7. Taylor expanded in x around 0 99.0%

      \[\leadsto \color{blue}{2.30753 + \left(-3.0191289437 \cdot x + 1.900161040244073 \cdot {x}^{2}\right)} \]
    8. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto 2.30753 + \color{blue}{\left(1.900161040244073 \cdot {x}^{2} + -3.0191289437 \cdot x\right)} \]
      2. unpow299.0%

        \[\leadsto 2.30753 + \left(1.900161040244073 \cdot \color{blue}{\left(x \cdot x\right)} + -3.0191289437 \cdot x\right) \]
      3. associate-*r*99.0%

        \[\leadsto 2.30753 + \left(\color{blue}{\left(1.900161040244073 \cdot x\right) \cdot x} + -3.0191289437 \cdot x\right) \]
      4. distribute-rgt-out99.0%

        \[\leadsto 2.30753 + \color{blue}{x \cdot \left(1.900161040244073 \cdot x + -3.0191289437\right)} \]
      5. *-commutative99.0%

        \[\leadsto 2.30753 + x \cdot \left(\color{blue}{x \cdot 1.900161040244073} + -3.0191289437\right) \]
    9. Simplified99.0%

      \[\leadsto \color{blue}{2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)} \]

    if 1.19999999999999996 < x

    1. Initial program 100.0%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Step-by-step derivation
      1. clear-num100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}}} - x \]
      2. inv-pow100.0%

        \[\leadsto \color{blue}{{\left(\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1}} - x \]
      3. +-commutative100.0%

        \[\leadsto {\left(\frac{\color{blue}{x \cdot \left(0.99229 + x \cdot 0.04481\right) + 1}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      4. fma-def100.0%

        \[\leadsto {\left(\frac{\color{blue}{\mathsf{fma}\left(x, 0.99229 + x \cdot 0.04481, 1\right)}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      5. +-commutative100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      6. fma-def100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.04481, 0.99229\right)}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      7. +-commutative100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}\right)}^{-1} - x \]
      8. fma-def100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}\right)}^{-1} - x \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}\right)}^{-1}} - x \]
    4. Step-by-step derivation
      1. unpow-1100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}} - x \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}} - x \]
    6. Taylor expanded in x around inf 99.8%

      \[\leadsto \frac{1}{\color{blue}{\left(2.254864010426164 + 0.16558885480950444 \cdot x\right) - 15.532191530167717 \cdot \frac{1}{x}}} - x \]
    7. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \frac{1}{\color{blue}{\left(0.16558885480950444 \cdot x + 2.254864010426164\right)} - 15.532191530167717 \cdot \frac{1}{x}} - x \]
      2. *-commutative99.8%

        \[\leadsto \frac{1}{\left(\color{blue}{x \cdot 0.16558885480950444} + 2.254864010426164\right) - 15.532191530167717 \cdot \frac{1}{x}} - x \]
      3. associate-*r/99.8%

        \[\leadsto \frac{1}{\left(x \cdot 0.16558885480950444 + 2.254864010426164\right) - \color{blue}{\frac{15.532191530167717 \cdot 1}{x}}} - x \]
      4. metadata-eval99.8%

        \[\leadsto \frac{1}{\left(x \cdot 0.16558885480950444 + 2.254864010426164\right) - \frac{\color{blue}{15.532191530167717}}{x}} - x \]
    8. Simplified99.8%

      \[\leadsto \frac{1}{\color{blue}{\left(x \cdot 0.16558885480950444 + 2.254864010426164\right) - \frac{15.532191530167717}{x}}} - x \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05:\\ \;\;\;\;\left(\frac{6.039053782637804}{x} - \frac{82.23527511657367}{x \cdot x}\right) - x\\ \mathbf{elif}\;x \leq 1.2:\\ \;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(x \cdot 0.16558885480950444 + 2.254864010426164\right) - \frac{15.532191530167717}{x}} - x\\ \end{array} \]

Alternative 3: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot 0.27061 + 2.30753}{1 + x \cdot \left(x \cdot 0.04481 + 0.99229\right)} - x \end{array} \]
(FPCore (x)
 :precision binary64
 (- (/ (+ (* x 0.27061) 2.30753) (+ 1.0 (* x (+ (* x 0.04481) 0.99229)))) x))
double code(double x) {
	return (((x * 0.27061) + 2.30753) / (1.0 + (x * ((x * 0.04481) + 0.99229)))) - x;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (((x * 0.27061d0) + 2.30753d0) / (1.0d0 + (x * ((x * 0.04481d0) + 0.99229d0)))) - x
end function
public static double code(double x) {
	return (((x * 0.27061) + 2.30753) / (1.0 + (x * ((x * 0.04481) + 0.99229)))) - x;
}
def code(x):
	return (((x * 0.27061) + 2.30753) / (1.0 + (x * ((x * 0.04481) + 0.99229)))) - x
function code(x)
	return Float64(Float64(Float64(Float64(x * 0.27061) + 2.30753) / Float64(1.0 + Float64(x * Float64(Float64(x * 0.04481) + 0.99229)))) - x)
end
function tmp = code(x)
	tmp = (((x * 0.27061) + 2.30753) / (1.0 + (x * ((x * 0.04481) + 0.99229)))) - x;
end
code[x_] := N[(N[(N[(N[(x * 0.27061), $MachinePrecision] + 2.30753), $MachinePrecision] / N[(1.0 + N[(x * N[(N[(x * 0.04481), $MachinePrecision] + 0.99229), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot 0.27061 + 2.30753}{1 + x \cdot \left(x \cdot 0.04481 + 0.99229\right)} - x
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
  2. Final simplification100.0%

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

Alternative 4: 99.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.05 \lor \neg \left(x \leq 1.56\right):\\ \;\;\;\;\frac{6.039053782637804}{x} - x\\ \mathbf{else}:\\ \;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (or (<= x -1.05) (not (<= x 1.56)))
   (- (/ 6.039053782637804 x) x)
   (+ 2.30753 (* x (+ (* x 1.900161040244073) -3.0191289437)))))
double code(double x) {
	double tmp;
	if ((x <= -1.05) || !(x <= 1.56)) {
		tmp = (6.039053782637804 / x) - x;
	} else {
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-1.05d0)) .or. (.not. (x <= 1.56d0))) then
        tmp = (6.039053782637804d0 / x) - x
    else
        tmp = 2.30753d0 + (x * ((x * 1.900161040244073d0) + (-3.0191289437d0)))
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if ((x <= -1.05) || !(x <= 1.56)) {
		tmp = (6.039053782637804 / x) - x;
	} else {
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x <= -1.05) or not (x <= 1.56):
		tmp = (6.039053782637804 / x) - x
	else:
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437))
	return tmp
function code(x)
	tmp = 0.0
	if ((x <= -1.05) || !(x <= 1.56))
		tmp = Float64(Float64(6.039053782637804 / x) - x);
	else
		tmp = Float64(2.30753 + Float64(x * Float64(Float64(x * 1.900161040244073) + -3.0191289437)));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x <= -1.05) || ~((x <= 1.56)))
		tmp = (6.039053782637804 / x) - x;
	else
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	end
	tmp_2 = tmp;
end
code[x_] := If[Or[LessEqual[x, -1.05], N[Not[LessEqual[x, 1.56]], $MachinePrecision]], N[(N[(6.039053782637804 / x), $MachinePrecision] - x), $MachinePrecision], N[(2.30753 + N[(x * N[(N[(x * 1.900161040244073), $MachinePrecision] + -3.0191289437), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \lor \neg \left(x \leq 1.56\right):\\
\;\;\;\;\frac{6.039053782637804}{x} - x\\

\mathbf{else}:\\
\;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.05000000000000004 or 1.5600000000000001 < x

    1. Initial program 100.0%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Taylor expanded in x around inf 98.6%

      \[\leadsto \color{blue}{\frac{6.039053782637804}{x}} - x \]

    if -1.05000000000000004 < x < 1.5600000000000001

    1. Initial program 99.9%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}}} - x \]
      2. inv-pow99.9%

        \[\leadsto \color{blue}{{\left(\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1}} - x \]
      3. +-commutative99.9%

        \[\leadsto {\left(\frac{\color{blue}{x \cdot \left(0.99229 + x \cdot 0.04481\right) + 1}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      4. fma-def99.9%

        \[\leadsto {\left(\frac{\color{blue}{\mathsf{fma}\left(x, 0.99229 + x \cdot 0.04481, 1\right)}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      5. +-commutative99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      6. fma-def99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.04481, 0.99229\right)}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      7. +-commutative99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}\right)}^{-1} - x \]
      8. fma-def99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}\right)}^{-1} - x \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}\right)}^{-1}} - x \]
    4. Taylor expanded in x around 0 99.0%

      \[\leadsto \color{blue}{\left(2.30753 + \left(-2.0191289437 \cdot x + 1.900161040244073 \cdot {x}^{2}\right)\right)} - x \]
    5. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto \left(2.30753 + \color{blue}{\left(1.900161040244073 \cdot {x}^{2} + -2.0191289437 \cdot x\right)}\right) - x \]
      2. unpow299.0%

        \[\leadsto \left(2.30753 + \left(1.900161040244073 \cdot \color{blue}{\left(x \cdot x\right)} + -2.0191289437 \cdot x\right)\right) - x \]
      3. *-commutative99.0%

        \[\leadsto \left(2.30753 + \left(1.900161040244073 \cdot \left(x \cdot x\right) + \color{blue}{x \cdot -2.0191289437}\right)\right) - x \]
      4. fma-def99.0%

        \[\leadsto \left(2.30753 + \color{blue}{\mathsf{fma}\left(1.900161040244073, x \cdot x, x \cdot -2.0191289437\right)}\right) - x \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{\left(2.30753 + \mathsf{fma}\left(1.900161040244073, x \cdot x, x \cdot -2.0191289437\right)\right)} - x \]
    7. Taylor expanded in x around 0 99.0%

      \[\leadsto \color{blue}{2.30753 + \left(-3.0191289437 \cdot x + 1.900161040244073 \cdot {x}^{2}\right)} \]
    8. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto 2.30753 + \color{blue}{\left(1.900161040244073 \cdot {x}^{2} + -3.0191289437 \cdot x\right)} \]
      2. unpow299.0%

        \[\leadsto 2.30753 + \left(1.900161040244073 \cdot \color{blue}{\left(x \cdot x\right)} + -3.0191289437 \cdot x\right) \]
      3. associate-*r*99.0%

        \[\leadsto 2.30753 + \left(\color{blue}{\left(1.900161040244073 \cdot x\right) \cdot x} + -3.0191289437 \cdot x\right) \]
      4. distribute-rgt-out99.0%

        \[\leadsto 2.30753 + \color{blue}{x \cdot \left(1.900161040244073 \cdot x + -3.0191289437\right)} \]
      5. *-commutative99.0%

        \[\leadsto 2.30753 + x \cdot \left(\color{blue}{x \cdot 1.900161040244073} + -3.0191289437\right) \]
    9. Simplified99.0%

      \[\leadsto \color{blue}{2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \lor \neg \left(x \leq 1.56\right):\\ \;\;\;\;\frac{6.039053782637804}{x} - x\\ \mathbf{else}:\\ \;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\ \end{array} \]

Alternative 5: 99.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.05 \lor \neg \left(x \leq 1.2\right):\\ \;\;\;\;\frac{1}{x \cdot 0.16558885480950444 + 2.254864010426164} - x\\ \mathbf{else}:\\ \;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (or (<= x -1.05) (not (<= x 1.2)))
   (- (/ 1.0 (+ (* x 0.16558885480950444) 2.254864010426164)) x)
   (+ 2.30753 (* x (+ (* x 1.900161040244073) -3.0191289437)))))
double code(double x) {
	double tmp;
	if ((x <= -1.05) || !(x <= 1.2)) {
		tmp = (1.0 / ((x * 0.16558885480950444) + 2.254864010426164)) - x;
	} else {
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-1.05d0)) .or. (.not. (x <= 1.2d0))) then
        tmp = (1.0d0 / ((x * 0.16558885480950444d0) + 2.254864010426164d0)) - x
    else
        tmp = 2.30753d0 + (x * ((x * 1.900161040244073d0) + (-3.0191289437d0)))
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if ((x <= -1.05) || !(x <= 1.2)) {
		tmp = (1.0 / ((x * 0.16558885480950444) + 2.254864010426164)) - x;
	} else {
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x <= -1.05) or not (x <= 1.2):
		tmp = (1.0 / ((x * 0.16558885480950444) + 2.254864010426164)) - x
	else:
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437))
	return tmp
function code(x)
	tmp = 0.0
	if ((x <= -1.05) || !(x <= 1.2))
		tmp = Float64(Float64(1.0 / Float64(Float64(x * 0.16558885480950444) + 2.254864010426164)) - x);
	else
		tmp = Float64(2.30753 + Float64(x * Float64(Float64(x * 1.900161040244073) + -3.0191289437)));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x <= -1.05) || ~((x <= 1.2)))
		tmp = (1.0 / ((x * 0.16558885480950444) + 2.254864010426164)) - x;
	else
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	end
	tmp_2 = tmp;
end
code[x_] := If[Or[LessEqual[x, -1.05], N[Not[LessEqual[x, 1.2]], $MachinePrecision]], N[(N[(1.0 / N[(N[(x * 0.16558885480950444), $MachinePrecision] + 2.254864010426164), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(2.30753 + N[(x * N[(N[(x * 1.900161040244073), $MachinePrecision] + -3.0191289437), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \lor \neg \left(x \leq 1.2\right):\\
\;\;\;\;\frac{1}{x \cdot 0.16558885480950444 + 2.254864010426164} - x\\

\mathbf{else}:\\
\;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.05000000000000004 or 1.19999999999999996 < x

    1. Initial program 100.0%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Step-by-step derivation
      1. clear-num100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}}} - x \]
      2. inv-pow100.0%

        \[\leadsto \color{blue}{{\left(\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1}} - x \]
      3. +-commutative100.0%

        \[\leadsto {\left(\frac{\color{blue}{x \cdot \left(0.99229 + x \cdot 0.04481\right) + 1}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      4. fma-def100.0%

        \[\leadsto {\left(\frac{\color{blue}{\mathsf{fma}\left(x, 0.99229 + x \cdot 0.04481, 1\right)}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      5. +-commutative100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      6. fma-def100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.04481, 0.99229\right)}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      7. +-commutative100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}\right)}^{-1} - x \]
      8. fma-def100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}\right)}^{-1} - x \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}\right)}^{-1}} - x \]
    4. Step-by-step derivation
      1. unpow-1100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}} - x \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}} - x \]
    6. Taylor expanded in x around inf 98.8%

      \[\leadsto \frac{1}{\color{blue}{2.254864010426164 + 0.16558885480950444 \cdot x}} - x \]
    7. Step-by-step derivation
      1. +-commutative98.8%

        \[\leadsto \frac{1}{\color{blue}{0.16558885480950444 \cdot x + 2.254864010426164}} - x \]
      2. *-commutative98.8%

        \[\leadsto \frac{1}{\color{blue}{x \cdot 0.16558885480950444} + 2.254864010426164} - x \]
    8. Simplified98.8%

      \[\leadsto \frac{1}{\color{blue}{x \cdot 0.16558885480950444 + 2.254864010426164}} - x \]

    if -1.05000000000000004 < x < 1.19999999999999996

    1. Initial program 99.9%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}}} - x \]
      2. inv-pow99.9%

        \[\leadsto \color{blue}{{\left(\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1}} - x \]
      3. +-commutative99.9%

        \[\leadsto {\left(\frac{\color{blue}{x \cdot \left(0.99229 + x \cdot 0.04481\right) + 1}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      4. fma-def99.9%

        \[\leadsto {\left(\frac{\color{blue}{\mathsf{fma}\left(x, 0.99229 + x \cdot 0.04481, 1\right)}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      5. +-commutative99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      6. fma-def99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.04481, 0.99229\right)}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      7. +-commutative99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}\right)}^{-1} - x \]
      8. fma-def99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}\right)}^{-1} - x \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}\right)}^{-1}} - x \]
    4. Taylor expanded in x around 0 99.0%

      \[\leadsto \color{blue}{\left(2.30753 + \left(-2.0191289437 \cdot x + 1.900161040244073 \cdot {x}^{2}\right)\right)} - x \]
    5. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto \left(2.30753 + \color{blue}{\left(1.900161040244073 \cdot {x}^{2} + -2.0191289437 \cdot x\right)}\right) - x \]
      2. unpow299.0%

        \[\leadsto \left(2.30753 + \left(1.900161040244073 \cdot \color{blue}{\left(x \cdot x\right)} + -2.0191289437 \cdot x\right)\right) - x \]
      3. *-commutative99.0%

        \[\leadsto \left(2.30753 + \left(1.900161040244073 \cdot \left(x \cdot x\right) + \color{blue}{x \cdot -2.0191289437}\right)\right) - x \]
      4. fma-def99.0%

        \[\leadsto \left(2.30753 + \color{blue}{\mathsf{fma}\left(1.900161040244073, x \cdot x, x \cdot -2.0191289437\right)}\right) - x \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{\left(2.30753 + \mathsf{fma}\left(1.900161040244073, x \cdot x, x \cdot -2.0191289437\right)\right)} - x \]
    7. Taylor expanded in x around 0 99.0%

      \[\leadsto \color{blue}{2.30753 + \left(-3.0191289437 \cdot x + 1.900161040244073 \cdot {x}^{2}\right)} \]
    8. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto 2.30753 + \color{blue}{\left(1.900161040244073 \cdot {x}^{2} + -3.0191289437 \cdot x\right)} \]
      2. unpow299.0%

        \[\leadsto 2.30753 + \left(1.900161040244073 \cdot \color{blue}{\left(x \cdot x\right)} + -3.0191289437 \cdot x\right) \]
      3. associate-*r*99.0%

        \[\leadsto 2.30753 + \left(\color{blue}{\left(1.900161040244073 \cdot x\right) \cdot x} + -3.0191289437 \cdot x\right) \]
      4. distribute-rgt-out99.0%

        \[\leadsto 2.30753 + \color{blue}{x \cdot \left(1.900161040244073 \cdot x + -3.0191289437\right)} \]
      5. *-commutative99.0%

        \[\leadsto 2.30753 + x \cdot \left(\color{blue}{x \cdot 1.900161040244073} + -3.0191289437\right) \]
    9. Simplified99.0%

      \[\leadsto \color{blue}{2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \lor \neg \left(x \leq 1.2\right):\\ \;\;\;\;\frac{1}{x \cdot 0.16558885480950444 + 2.254864010426164} - x\\ \mathbf{else}:\\ \;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\ \end{array} \]

Alternative 6: 99.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.05:\\ \;\;\;\;\left(\frac{6.039053782637804}{x} - \frac{82.23527511657367}{x \cdot x}\right) - x\\ \mathbf{elif}\;x \leq 1.2:\\ \;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot 0.16558885480950444 + 2.254864010426164} - x\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x -1.05)
   (- (- (/ 6.039053782637804 x) (/ 82.23527511657367 (* x x))) x)
   (if (<= x 1.2)
     (+ 2.30753 (* x (+ (* x 1.900161040244073) -3.0191289437)))
     (- (/ 1.0 (+ (* x 0.16558885480950444) 2.254864010426164)) x))))
double code(double x) {
	double tmp;
	if (x <= -1.05) {
		tmp = ((6.039053782637804 / x) - (82.23527511657367 / (x * x))) - x;
	} else if (x <= 1.2) {
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	} else {
		tmp = (1.0 / ((x * 0.16558885480950444) + 2.254864010426164)) - x;
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= (-1.05d0)) then
        tmp = ((6.039053782637804d0 / x) - (82.23527511657367d0 / (x * x))) - x
    else if (x <= 1.2d0) then
        tmp = 2.30753d0 + (x * ((x * 1.900161040244073d0) + (-3.0191289437d0)))
    else
        tmp = (1.0d0 / ((x * 0.16558885480950444d0) + 2.254864010426164d0)) - x
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if (x <= -1.05) {
		tmp = ((6.039053782637804 / x) - (82.23527511657367 / (x * x))) - x;
	} else if (x <= 1.2) {
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	} else {
		tmp = (1.0 / ((x * 0.16558885480950444) + 2.254864010426164)) - x;
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= -1.05:
		tmp = ((6.039053782637804 / x) - (82.23527511657367 / (x * x))) - x
	elif x <= 1.2:
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437))
	else:
		tmp = (1.0 / ((x * 0.16558885480950444) + 2.254864010426164)) - x
	return tmp
function code(x)
	tmp = 0.0
	if (x <= -1.05)
		tmp = Float64(Float64(Float64(6.039053782637804 / x) - Float64(82.23527511657367 / Float64(x * x))) - x);
	elseif (x <= 1.2)
		tmp = Float64(2.30753 + Float64(x * Float64(Float64(x * 1.900161040244073) + -3.0191289437)));
	else
		tmp = Float64(Float64(1.0 / Float64(Float64(x * 0.16558885480950444) + 2.254864010426164)) - x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= -1.05)
		tmp = ((6.039053782637804 / x) - (82.23527511657367 / (x * x))) - x;
	elseif (x <= 1.2)
		tmp = 2.30753 + (x * ((x * 1.900161040244073) + -3.0191289437));
	else
		tmp = (1.0 / ((x * 0.16558885480950444) + 2.254864010426164)) - x;
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, -1.05], N[(N[(N[(6.039053782637804 / x), $MachinePrecision] - N[(82.23527511657367 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 1.2], N[(2.30753 + N[(x * N[(N[(x * 1.900161040244073), $MachinePrecision] + -3.0191289437), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(x * 0.16558885480950444), $MachinePrecision] + 2.254864010426164), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05:\\
\;\;\;\;\left(\frac{6.039053782637804}{x} - \frac{82.23527511657367}{x \cdot x}\right) - x\\

\mathbf{elif}\;x \leq 1.2:\\
\;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot 0.16558885480950444 + 2.254864010426164} - x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.05000000000000004

    1. Initial program 100.0%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Taylor expanded in x around inf 97.9%

      \[\leadsto \color{blue}{\left(6.039053782637804 \cdot \frac{1}{x} - 82.23527511657367 \cdot \frac{1}{{x}^{2}}\right)} - x \]
    3. Step-by-step derivation
      1. associate-*r/97.9%

        \[\leadsto \left(\color{blue}{\frac{6.039053782637804 \cdot 1}{x}} - 82.23527511657367 \cdot \frac{1}{{x}^{2}}\right) - x \]
      2. metadata-eval97.9%

        \[\leadsto \left(\frac{\color{blue}{6.039053782637804}}{x} - 82.23527511657367 \cdot \frac{1}{{x}^{2}}\right) - x \]
      3. unpow297.9%

        \[\leadsto \left(\frac{6.039053782637804}{x} - 82.23527511657367 \cdot \frac{1}{\color{blue}{x \cdot x}}\right) - x \]
      4. associate-*r/97.9%

        \[\leadsto \left(\frac{6.039053782637804}{x} - \color{blue}{\frac{82.23527511657367 \cdot 1}{x \cdot x}}\right) - x \]
      5. metadata-eval97.9%

        \[\leadsto \left(\frac{6.039053782637804}{x} - \frac{\color{blue}{82.23527511657367}}{x \cdot x}\right) - x \]
    4. Simplified97.9%

      \[\leadsto \color{blue}{\left(\frac{6.039053782637804}{x} - \frac{82.23527511657367}{x \cdot x}\right)} - x \]

    if -1.05000000000000004 < x < 1.19999999999999996

    1. Initial program 99.9%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}}} - x \]
      2. inv-pow99.9%

        \[\leadsto \color{blue}{{\left(\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1}} - x \]
      3. +-commutative99.9%

        \[\leadsto {\left(\frac{\color{blue}{x \cdot \left(0.99229 + x \cdot 0.04481\right) + 1}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      4. fma-def99.9%

        \[\leadsto {\left(\frac{\color{blue}{\mathsf{fma}\left(x, 0.99229 + x \cdot 0.04481, 1\right)}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      5. +-commutative99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      6. fma-def99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.04481, 0.99229\right)}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      7. +-commutative99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}\right)}^{-1} - x \]
      8. fma-def99.9%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}\right)}^{-1} - x \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}\right)}^{-1}} - x \]
    4. Taylor expanded in x around 0 99.0%

      \[\leadsto \color{blue}{\left(2.30753 + \left(-2.0191289437 \cdot x + 1.900161040244073 \cdot {x}^{2}\right)\right)} - x \]
    5. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto \left(2.30753 + \color{blue}{\left(1.900161040244073 \cdot {x}^{2} + -2.0191289437 \cdot x\right)}\right) - x \]
      2. unpow299.0%

        \[\leadsto \left(2.30753 + \left(1.900161040244073 \cdot \color{blue}{\left(x \cdot x\right)} + -2.0191289437 \cdot x\right)\right) - x \]
      3. *-commutative99.0%

        \[\leadsto \left(2.30753 + \left(1.900161040244073 \cdot \left(x \cdot x\right) + \color{blue}{x \cdot -2.0191289437}\right)\right) - x \]
      4. fma-def99.0%

        \[\leadsto \left(2.30753 + \color{blue}{\mathsf{fma}\left(1.900161040244073, x \cdot x, x \cdot -2.0191289437\right)}\right) - x \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{\left(2.30753 + \mathsf{fma}\left(1.900161040244073, x \cdot x, x \cdot -2.0191289437\right)\right)} - x \]
    7. Taylor expanded in x around 0 99.0%

      \[\leadsto \color{blue}{2.30753 + \left(-3.0191289437 \cdot x + 1.900161040244073 \cdot {x}^{2}\right)} \]
    8. Step-by-step derivation
      1. +-commutative99.0%

        \[\leadsto 2.30753 + \color{blue}{\left(1.900161040244073 \cdot {x}^{2} + -3.0191289437 \cdot x\right)} \]
      2. unpow299.0%

        \[\leadsto 2.30753 + \left(1.900161040244073 \cdot \color{blue}{\left(x \cdot x\right)} + -3.0191289437 \cdot x\right) \]
      3. associate-*r*99.0%

        \[\leadsto 2.30753 + \left(\color{blue}{\left(1.900161040244073 \cdot x\right) \cdot x} + -3.0191289437 \cdot x\right) \]
      4. distribute-rgt-out99.0%

        \[\leadsto 2.30753 + \color{blue}{x \cdot \left(1.900161040244073 \cdot x + -3.0191289437\right)} \]
      5. *-commutative99.0%

        \[\leadsto 2.30753 + x \cdot \left(\color{blue}{x \cdot 1.900161040244073} + -3.0191289437\right) \]
    9. Simplified99.0%

      \[\leadsto \color{blue}{2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)} \]

    if 1.19999999999999996 < x

    1. Initial program 100.0%

      \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
    2. Step-by-step derivation
      1. clear-num100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}}} - x \]
      2. inv-pow100.0%

        \[\leadsto \color{blue}{{\left(\frac{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1}} - x \]
      3. +-commutative100.0%

        \[\leadsto {\left(\frac{\color{blue}{x \cdot \left(0.99229 + x \cdot 0.04481\right) + 1}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      4. fma-def100.0%

        \[\leadsto {\left(\frac{\color{blue}{\mathsf{fma}\left(x, 0.99229 + x \cdot 0.04481, 1\right)}}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      5. +-commutative100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{x \cdot 0.04481 + 0.99229}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      6. fma-def100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.04481, 0.99229\right)}, 1\right)}{2.30753 + x \cdot 0.27061}\right)}^{-1} - x \]
      7. +-commutative100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{x \cdot 0.27061 + 2.30753}}\right)}^{-1} - x \]
      8. fma-def100.0%

        \[\leadsto {\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\color{blue}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}\right)}^{-1} - x \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}\right)}^{-1}} - x \]
    4. Step-by-step derivation
      1. unpow-1100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}} - x \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1\right)}{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}}} - x \]
    6. Taylor expanded in x around inf 99.7%

      \[\leadsto \frac{1}{\color{blue}{2.254864010426164 + 0.16558885480950444 \cdot x}} - x \]
    7. Step-by-step derivation
      1. +-commutative99.7%

        \[\leadsto \frac{1}{\color{blue}{0.16558885480950444 \cdot x + 2.254864010426164}} - x \]
      2. *-commutative99.7%

        \[\leadsto \frac{1}{\color{blue}{x \cdot 0.16558885480950444} + 2.254864010426164} - x \]
    8. Simplified99.7%

      \[\leadsto \frac{1}{\color{blue}{x \cdot 0.16558885480950444 + 2.254864010426164}} - x \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05:\\ \;\;\;\;\left(\frac{6.039053782637804}{x} - \frac{82.23527511657367}{x \cdot x}\right) - x\\ \mathbf{elif}\;x \leq 1.2:\\ \;\;\;\;2.30753 + x \cdot \left(x \cdot 1.900161040244073 + -3.0191289437\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot 0.16558885480950444 + 2.254864010426164} - x\\ \end{array} \]

Alternative 7: 98.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \frac{x \cdot 0.27061 + 2.30753}{1 + x \cdot 0.99229} - x \end{array} \]
(FPCore (x)
 :precision binary64
 (- (/ (+ (* x 0.27061) 2.30753) (+ 1.0 (* x 0.99229))) x))
double code(double x) {
	return (((x * 0.27061) + 2.30753) / (1.0 + (x * 0.99229))) - x;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (((x * 0.27061d0) + 2.30753d0) / (1.0d0 + (x * 0.99229d0))) - x
end function
public static double code(double x) {
	return (((x * 0.27061) + 2.30753) / (1.0 + (x * 0.99229))) - x;
}
def code(x):
	return (((x * 0.27061) + 2.30753) / (1.0 + (x * 0.99229))) - x
function code(x)
	return Float64(Float64(Float64(Float64(x * 0.27061) + 2.30753) / Float64(1.0 + Float64(x * 0.99229))) - x)
end
function tmp = code(x)
	tmp = (((x * 0.27061) + 2.30753) / (1.0 + (x * 0.99229))) - x;
end
code[x_] := N[(N[(N[(N[(x * 0.27061), $MachinePrecision] + 2.30753), $MachinePrecision] / N[(1.0 + N[(x * 0.99229), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot 0.27061 + 2.30753}{1 + x \cdot 0.99229} - x
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
  2. Taylor expanded in x around 0 97.6%

    \[\leadsto \frac{2.30753 + x \cdot 0.27061}{1 + \color{blue}{0.99229 \cdot x}} - x \]
  3. Step-by-step derivation
    1. *-commutative97.6%

      \[\leadsto \frac{2.30753 + x \cdot 0.27061}{1 + \color{blue}{x \cdot 0.99229}} - x \]
  4. Simplified97.6%

    \[\leadsto \frac{2.30753 + x \cdot 0.27061}{1 + \color{blue}{x \cdot 0.99229}} - x \]
  5. Final simplification97.6%

    \[\leadsto \frac{x \cdot 0.27061 + 2.30753}{1 + x \cdot 0.99229} - x \]

Alternative 8: 97.9% accurate, 5.7× speedup?

\[\begin{array}{l} \\ 2.30753 - x \end{array} \]
(FPCore (x) :precision binary64 (- 2.30753 x))
double code(double x) {
	return 2.30753 - x;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 2.30753d0 - x
end function
public static double code(double x) {
	return 2.30753 - x;
}
def code(x):
	return 2.30753 - x
function code(x)
	return Float64(2.30753 - x)
end
function tmp = code(x)
	tmp = 2.30753 - x;
end
code[x_] := N[(2.30753 - x), $MachinePrecision]
\begin{array}{l}

\\
2.30753 - x
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
  2. Taylor expanded in x around 0 96.7%

    \[\leadsto \color{blue}{2.30753} - x \]
  3. Final simplification96.7%

    \[\leadsto 2.30753 - x \]

Alternative 9: 52.5% accurate, 8.5× speedup?

\[\begin{array}{l} \\ -x \end{array} \]
(FPCore (x) :precision binary64 (- x))
double code(double x) {
	return -x;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = -x
end function
public static double code(double x) {
	return -x;
}
def code(x):
	return -x
function code(x)
	return Float64(-x)
end
function tmp = code(x)
	tmp = -x;
end
code[x_] := (-x)
\begin{array}{l}

\\
-x
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{2.30753 + x \cdot 0.27061}{1 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x \]
  2. Taylor expanded in x around 0 96.7%

    \[\leadsto \color{blue}{2.30753} - x \]
  3. Taylor expanded in x around inf 56.9%

    \[\leadsto \color{blue}{-1 \cdot x} \]
  4. Step-by-step derivation
    1. neg-mul-156.9%

      \[\leadsto \color{blue}{-x} \]
  5. Simplified56.9%

    \[\leadsto \color{blue}{-x} \]
  6. Final simplification56.9%

    \[\leadsto -x \]

Reproduce

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