Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A

Percentage Accurate: 95.4% → 99.7%
Time: 12.5s
Alternatives: 12
Speedup: 3.9×

Specification

?
\[\begin{array}{l} \\ x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z):
	return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z)
	return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))))
end
function tmp = code(x, y, z)
	tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\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 12 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: 95.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z):
	return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z)
	return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))))
end
function tmp = code(x, y, z)
	tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}

Alternative 1: 99.7% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -17:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 9:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.18806319451591877, 0.5641895835477563\right), 1.1283791670955126\right), 1.1283791670955126 - x \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -17.0)
   (+ x (/ -1.0 x))
   (if (<= z 9.0)
     (+
      x
      (/
       y
       (fma
        z
        (fma
         z
         (fma z 0.18806319451591877 0.5641895835477563)
         1.1283791670955126)
        (- 1.1283791670955126 (* x y)))))
     x)))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -17.0) {
		tmp = x + (-1.0 / x);
	} else if (z <= 9.0) {
		tmp = x + (y / fma(z, fma(z, fma(z, 0.18806319451591877, 0.5641895835477563), 1.1283791670955126), (1.1283791670955126 - (x * y))));
	} else {
		tmp = x;
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -17.0)
		tmp = Float64(x + Float64(-1.0 / x));
	elseif (z <= 9.0)
		tmp = Float64(x + Float64(y / fma(z, fma(z, fma(z, 0.18806319451591877, 0.5641895835477563), 1.1283791670955126), Float64(1.1283791670955126 - Float64(x * y)))));
	else
		tmp = x;
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -17.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(y / N[(z * N[(z * N[(z * 0.18806319451591877 + 0.5641895835477563), $MachinePrecision] + 1.1283791670955126), $MachinePrecision] + N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -17:\\
\;\;\;\;x + \frac{-1}{x}\\

\mathbf{elif}\;z \leq 9:\\
\;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.18806319451591877, 0.5641895835477563\right), 1.1283791670955126\right), 1.1283791670955126 - x \cdot y\right)}\\

\mathbf{else}:\\
\;\;\;\;x\\


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

    1. Initial program 94.2%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{x - \frac{1}{x}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)}\right) \]
      3. distribute-neg-fracN/A

        \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{\color{blue}{x}}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{-1}{x}\right)\right) \]
      5. /-lowering-/.f64100.0%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{x}\right)\right) \]
    5. Simplified100.0%

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

    if -17 < z < 9

    1. Initial program 99.8%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \color{blue}{\left(\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{30000000000000000} \cdot z\right)\right)\right) - x \cdot y\right)}\right)\right) \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \left(\left(z \cdot \left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{30000000000000000} \cdot z\right)\right) + \frac{5641895835477563}{5000000000000000}\right) - \color{blue}{x} \cdot y\right)\right)\right) \]
      2. associate--l+N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \left(z \cdot \left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{30000000000000000} \cdot z\right)\right) + \color{blue}{\left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)}\right)\right)\right) \]
      3. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \color{blue}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{30000000000000000} \cdot z\right)\right)}, \left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \left(z \cdot \left(\frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{30000000000000000} \cdot z\right) + \color{blue}{\frac{5641895835477563}{5000000000000000}}\right), \left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)\right)\right)\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \color{blue}{\left(\frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{30000000000000000} \cdot z\right)}, \frac{5641895835477563}{5000000000000000}\right), \left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)\right)\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \left(\frac{5641895835477563}{30000000000000000} \cdot z + \color{blue}{\frac{5641895835477563}{10000000000000000}}\right), \frac{5641895835477563}{5000000000000000}\right), \left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \left(z \cdot \frac{5641895835477563}{30000000000000000} + \frac{5641895835477563}{10000000000000000}\right), \frac{5641895835477563}{5000000000000000}\right), \left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)\right)\right)\right) \]
      8. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \color{blue}{\frac{5641895835477563}{30000000000000000}}, \frac{5641895835477563}{10000000000000000}\right), \frac{5641895835477563}{5000000000000000}\right), \left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \frac{5641895835477563}{30000000000000000}, \frac{5641895835477563}{10000000000000000}\right), \color{blue}{\frac{5641895835477563}{5000000000000000}}\right), \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \left(x \cdot y\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \frac{5641895835477563}{30000000000000000}, \frac{5641895835477563}{10000000000000000}\right), \frac{5641895835477563}{5000000000000000}\right), \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \left(y \cdot x\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \frac{5641895835477563}{30000000000000000}, \frac{5641895835477563}{10000000000000000}\right), \frac{5641895835477563}{5000000000000000}\right), \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \mathsf{*.f64}\left(y, x\right)\right)\right)\right)\right) \]
    5. Simplified99.6%

      \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.18806319451591877, 0.5641895835477563\right), 1.1283791670955126\right), 1.1283791670955126 - y \cdot x\right)}} \]

    if 9 < z

    1. Initial program 93.3%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x} \]
    4. Step-by-step derivation
      1. Simplified100.0%

        \[\leadsto \color{blue}{x} \]
    5. Recombined 3 regimes into one program.
    6. Final simplification99.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -17:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 9:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.18806319451591877, 0.5641895835477563\right), 1.1283791670955126\right), 1.1283791670955126 - x \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
    7. Add Preprocessing

    Alternative 2: 98.4% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+262}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x + \frac{-1}{x}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y))))))
       (if (<= t_0 5e+262) t_0 (+ x (/ -1.0 x)))))
    double code(double x, double y, double z) {
    	double t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
    	double tmp;
    	if (t_0 <= 5e+262) {
    		tmp = t_0;
    	} else {
    		tmp = x + (-1.0 / x);
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
        if (t_0 <= 5d+262) then
            tmp = t_0
        else
            tmp = x + ((-1.0d0) / x)
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
    	double tmp;
    	if (t_0 <= 5e+262) {
    		tmp = t_0;
    	} else {
    		tmp = x + (-1.0 / x);
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y)))
    	tmp = 0
    	if t_0 <= 5e+262:
    		tmp = t_0
    	else:
    		tmp = x + (-1.0 / x)
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y))))
    	tmp = 0.0
    	if (t_0 <= 5e+262)
    		tmp = t_0;
    	else
    		tmp = Float64(x + Float64(-1.0 / x));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
    	tmp = 0.0;
    	if (t_0 <= 5e+262)
    		tmp = t_0;
    	else
    		tmp = x + (-1.0 / x);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+262], t$95$0, N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
    \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+262}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;x + \frac{-1}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 5.00000000000000008e262

      1. Initial program 99.4%

        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. Add Preprocessing

      if 5.00000000000000008e262 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y))))

      1. Initial program 65.3%

        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

        \[\leadsto \color{blue}{x - \frac{1}{x}} \]
      4. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)}\right) \]
        3. distribute-neg-fracN/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{\color{blue}{x}}\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{-1}{x}\right)\right) \]
        5. /-lowering-/.f64100.0%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{x}\right)\right) \]
      5. Simplified100.0%

        \[\leadsto \color{blue}{x + \frac{-1}{x}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification99.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y} \leq 5 \cdot 10^{+262}:\\ \;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{-1}{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 3: 97.0% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \mathsf{fma}\left(\frac{-1}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}, y, x\right) \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (fma (/ -1.0 (fma x y (* (exp z) -1.1283791670955126))) y x))
    double code(double x, double y, double z) {
    	return fma((-1.0 / fma(x, y, (exp(z) * -1.1283791670955126))), y, x);
    }
    
    function code(x, y, z)
    	return fma(Float64(-1.0 / fma(x, y, Float64(exp(z) * -1.1283791670955126))), y, x)
    end
    
    code[x_, y_, z_] := N[(N[(-1.0 / N[(x * y + N[(N[Exp[z], $MachinePrecision] * -1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \mathsf{fma}\left(\frac{-1}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}, y, x\right)
    \end{array}
    
    Derivation
    1. Initial program 97.1%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y} + \color{blue}{x} \]
      2. *-lft-identityN/A

        \[\leadsto \frac{1 \cdot y}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y} + x \]
      3. associate-*l/N/A

        \[\leadsto \frac{1}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y} \cdot y + x \]
      4. flip--N/A

        \[\leadsto \frac{1}{\frac{\left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) - \left(x \cdot y\right) \cdot \left(x \cdot y\right)}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + x \cdot y}} \cdot y + x \]
      5. clear-numN/A

        \[\leadsto \frac{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + x \cdot y}{\left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) - \left(x \cdot y\right) \cdot \left(x \cdot y\right)} \cdot y + x \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(\frac{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + x \cdot y}{\left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) - \left(x \cdot y\right) \cdot \left(x \cdot y\right)}\right), \color{blue}{y}, x\right) \]
    4. Applied egg-rr98.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}, y, x\right)} \]
    5. Add Preprocessing

    Alternative 4: 99.6% accurate, 2.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -350:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 9:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right) - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= z -350.0)
       (+ x (/ -1.0 x))
       (if (<= z 9.0)
         (+
          x
          (/
           y
           (-
            (fma
             z
             (fma z 0.5641895835477563 1.1283791670955126)
             1.1283791670955126)
            (* x y))))
         x)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (z <= -350.0) {
    		tmp = x + (-1.0 / x);
    	} else if (z <= 9.0) {
    		tmp = x + (y / (fma(z, fma(z, 0.5641895835477563, 1.1283791670955126), 1.1283791670955126) - (x * y)));
    	} else {
    		tmp = x;
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	tmp = 0.0
    	if (z <= -350.0)
    		tmp = Float64(x + Float64(-1.0 / x));
    	elseif (z <= 9.0)
    		tmp = Float64(x + Float64(y / Float64(fma(z, fma(z, 0.5641895835477563, 1.1283791670955126), 1.1283791670955126) - Float64(x * y))));
    	else
    		tmp = x;
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := If[LessEqual[z, -350.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(y / N[(N[(z * N[(z * 0.5641895835477563 + 1.1283791670955126), $MachinePrecision] + 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -350:\\
    \;\;\;\;x + \frac{-1}{x}\\
    
    \mathbf{elif}\;z \leq 9:\\
    \;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right) - x \cdot y}\\
    
    \mathbf{else}:\\
    \;\;\;\;x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -350

      1. Initial program 94.2%

        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

        \[\leadsto \color{blue}{x - \frac{1}{x}} \]
      4. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)}\right) \]
        3. distribute-neg-fracN/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{\color{blue}{x}}\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{-1}{x}\right)\right) \]
        5. /-lowering-/.f64100.0%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{x}\right)\right) \]
      5. Simplified100.0%

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

      if -350 < z < 9

      1. Initial program 99.8%

        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right)\right)}, \mathsf{*.f64}\left(x, y\right)\right)\right)\right) \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\left(z \cdot \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right) + \frac{5641895835477563}{5000000000000000}\right), \mathsf{*.f64}\left(\color{blue}{x}, y\right)\right)\right)\right) \]
        2. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(z, \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right), \frac{5641895835477563}{5000000000000000}\right), \mathsf{*.f64}\left(\color{blue}{x}, y\right)\right)\right)\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(z, \left(\frac{5641895835477563}{10000000000000000} \cdot z + \frac{5641895835477563}{5000000000000000}\right), \frac{5641895835477563}{5000000000000000}\right), \mathsf{*.f64}\left(x, y\right)\right)\right)\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(z, \left(z \cdot \frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{5000000000000000}\right), \frac{5641895835477563}{5000000000000000}\right), \mathsf{*.f64}\left(x, y\right)\right)\right)\right) \]
        5. accelerator-lowering-fma.f6499.5%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(z, \mathsf{fma.f64}\left(z, \frac{5641895835477563}{10000000000000000}, \frac{5641895835477563}{5000000000000000}\right), \frac{5641895835477563}{5000000000000000}\right), \mathsf{*.f64}\left(x, y\right)\right)\right)\right) \]
      5. Simplified99.5%

        \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right)} - x \cdot y} \]

      if 9 < z

      1. Initial program 93.3%

        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x} \]
      4. Step-by-step derivation
        1. Simplified100.0%

          \[\leadsto \color{blue}{x} \]
      5. Recombined 3 regimes into one program.
      6. Add Preprocessing

      Alternative 5: 99.6% accurate, 3.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -225:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 9:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(y, 0 - x, \mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= z -225.0)
         (+ x (/ -1.0 x))
         (if (<= z 9.0)
           (+
            x
            (/ y (fma y (- 0.0 x) (fma z 1.1283791670955126 1.1283791670955126))))
           x)))
      double code(double x, double y, double z) {
      	double tmp;
      	if (z <= -225.0) {
      		tmp = x + (-1.0 / x);
      	} else if (z <= 9.0) {
      		tmp = x + (y / fma(y, (0.0 - x), fma(z, 1.1283791670955126, 1.1283791670955126)));
      	} else {
      		tmp = x;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (z <= -225.0)
      		tmp = Float64(x + Float64(-1.0 / x));
      	elseif (z <= 9.0)
      		tmp = Float64(x + Float64(y / fma(y, Float64(0.0 - x), fma(z, 1.1283791670955126, 1.1283791670955126))));
      	else
      		tmp = x;
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[LessEqual[z, -225.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(y / N[(y * N[(0.0 - x), $MachinePrecision] + N[(z * 1.1283791670955126 + 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -225:\\
      \;\;\;\;x + \frac{-1}{x}\\
      
      \mathbf{elif}\;z \leq 9:\\
      \;\;\;\;x + \frac{y}{\mathsf{fma}\left(y, 0 - x, \mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right)\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -225

        1. Initial program 94.2%

          \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{x - \frac{1}{x}} \]
        4. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)}\right) \]
          3. distribute-neg-fracN/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{\color{blue}{x}}\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{-1}{x}\right)\right) \]
          5. /-lowering-/.f64100.0%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{x}\right)\right) \]
        5. Simplified100.0%

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

        if -225 < z < 9

        1. Initial program 99.8%

          \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \color{blue}{\left(\left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right) - x \cdot y\right)}\right)\right) \]
        4. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \left(\left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right) + \color{blue}{\left(\mathsf{neg}\left(x \cdot y\right)\right)}\right)\right)\right) \]
          2. +-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \left(\left(\mathsf{neg}\left(x \cdot y\right)\right) + \color{blue}{\left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)}\right)\right)\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \left(\left(\mathsf{neg}\left(y \cdot x\right)\right) + \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)\right)\right)\right) \]
          4. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \left(y \cdot \left(\mathsf{neg}\left(x\right)\right) + \left(\color{blue}{\frac{5641895835477563}{5000000000000000}} + \frac{5641895835477563}{5000000000000000} \cdot z\right)\right)\right)\right) \]
          5. mul-1-negN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \left(y \cdot \left(-1 \cdot x\right) + \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)\right)\right)\right) \]
          6. accelerator-lowering-fma.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(y, \color{blue}{\left(-1 \cdot x\right)}, \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)\right)\right)\right) \]
          7. mul-1-negN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(y, \left(\mathsf{neg}\left(x\right)\right), \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)\right)\right)\right) \]
          8. neg-sub0N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(y, \left(0 - \color{blue}{x}\right), \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)\right)\right)\right) \]
          9. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(0, \color{blue}{x}\right), \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)\right)\right)\right) \]
          10. +-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(0, x\right), \left(\frac{5641895835477563}{5000000000000000} \cdot z + \frac{5641895835477563}{5000000000000000}\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(0, x\right), \left(z \cdot \frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000}\right)\right)\right)\right) \]
          12. accelerator-lowering-fma.f6499.4%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(0, x\right), \mathsf{fma.f64}\left(z, \frac{5641895835477563}{5000000000000000}, \frac{5641895835477563}{5000000000000000}\right)\right)\right)\right) \]
        5. Simplified99.4%

          \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(y, 0 - x, \mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right)\right)}} \]

        if 9 < z

        1. Initial program 93.3%

          \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified100.0%

            \[\leadsto \color{blue}{x} \]
        5. Recombined 3 regimes into one program.
        6. Add Preprocessing

        Alternative 6: 99.6% accurate, 3.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -150:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 9:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right) - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= z -150.0)
           (+ x (/ -1.0 x))
           (if (<= z 9.0)
             (+ x (/ y (- (fma z 1.1283791670955126 1.1283791670955126) (* x y))))
             x)))
        double code(double x, double y, double z) {
        	double tmp;
        	if (z <= -150.0) {
        		tmp = x + (-1.0 / x);
        	} else if (z <= 9.0) {
        		tmp = x + (y / (fma(z, 1.1283791670955126, 1.1283791670955126) - (x * y)));
        	} else {
        		tmp = x;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if (z <= -150.0)
        		tmp = Float64(x + Float64(-1.0 / x));
        	elseif (z <= 9.0)
        		tmp = Float64(x + Float64(y / Float64(fma(z, 1.1283791670955126, 1.1283791670955126) - Float64(x * y))));
        	else
        		tmp = x;
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[LessEqual[z, -150.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(y / N[(N[(z * 1.1283791670955126 + 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -150:\\
        \;\;\;\;x + \frac{-1}{x}\\
        
        \mathbf{elif}\;z \leq 9:\\
        \;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right) - x \cdot y}\\
        
        \mathbf{else}:\\
        \;\;\;\;x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -150

          1. Initial program 94.2%

            \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
          2. Add Preprocessing
          3. Taylor expanded in y around inf

            \[\leadsto \color{blue}{x - \frac{1}{x}} \]
          4. Step-by-step derivation
            1. sub-negN/A

              \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)}\right) \]
            3. distribute-neg-fracN/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{\color{blue}{x}}\right)\right) \]
            4. metadata-evalN/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{-1}{x}\right)\right) \]
            5. /-lowering-/.f64100.0%

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{x}\right)\right) \]
          5. Simplified100.0%

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

          if -150 < z < 9

          1. Initial program 99.8%

            \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
          2. Add Preprocessing
          3. Taylor expanded in z around 0

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)}, \mathsf{*.f64}\left(x, y\right)\right)\right)\right) \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\left(\frac{5641895835477563}{5000000000000000} \cdot z + \frac{5641895835477563}{5000000000000000}\right), \mathsf{*.f64}\left(\color{blue}{x}, y\right)\right)\right)\right) \]
            2. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\left(z \cdot \frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000}\right), \mathsf{*.f64}\left(x, y\right)\right)\right)\right) \]
            3. accelerator-lowering-fma.f6499.4%

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(z, \frac{5641895835477563}{5000000000000000}, \frac{5641895835477563}{5000000000000000}\right), \mathsf{*.f64}\left(\color{blue}{x}, y\right)\right)\right)\right) \]
          5. Simplified99.4%

            \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right)} - x \cdot y} \]

          if 9 < z

          1. Initial program 93.3%

            \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
          2. Add Preprocessing
          3. Taylor expanded in x around inf

            \[\leadsto \color{blue}{x} \]
          4. Step-by-step derivation
            1. Simplified100.0%

              \[\leadsto \color{blue}{x} \]
          5. Recombined 3 regimes into one program.
          6. Add Preprocessing

          Alternative 7: 99.5% accurate, 3.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -95:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 9:\\ \;\;\;\;x - \frac{y}{\mathsf{fma}\left(y, x, -1.1283791670955126\right)}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= z -95.0)
             (+ x (/ -1.0 x))
             (if (<= z 9.0) (- x (/ y (fma y x -1.1283791670955126))) x)))
          double code(double x, double y, double z) {
          	double tmp;
          	if (z <= -95.0) {
          		tmp = x + (-1.0 / x);
          	} else if (z <= 9.0) {
          		tmp = x - (y / fma(y, x, -1.1283791670955126));
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (z <= -95.0)
          		tmp = Float64(x + Float64(-1.0 / x));
          	elseif (z <= 9.0)
          		tmp = Float64(x - Float64(y / fma(y, x, -1.1283791670955126)));
          	else
          		tmp = x;
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[z, -95.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x - N[(y / N[(y * x + -1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -95:\\
          \;\;\;\;x + \frac{-1}{x}\\
          
          \mathbf{elif}\;z \leq 9:\\
          \;\;\;\;x - \frac{y}{\mathsf{fma}\left(y, x, -1.1283791670955126\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -95

            1. Initial program 94.2%

              \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
            2. Add Preprocessing
            3. Taylor expanded in y around inf

              \[\leadsto \color{blue}{x - \frac{1}{x}} \]
            4. Step-by-step derivation
              1. sub-negN/A

                \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
              2. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)}\right) \]
              3. distribute-neg-fracN/A

                \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{\color{blue}{x}}\right)\right) \]
              4. metadata-evalN/A

                \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{-1}{x}\right)\right) \]
              5. /-lowering-/.f64100.0%

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{x}\right)\right) \]
            5. Simplified100.0%

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

            if -95 < z < 9

            1. Initial program 99.8%

              \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y} + \color{blue}{x} \]
              2. *-lft-identityN/A

                \[\leadsto \frac{1 \cdot y}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y} + x \]
              3. associate-*l/N/A

                \[\leadsto \frac{1}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y} \cdot y + x \]
              4. flip--N/A

                \[\leadsto \frac{1}{\frac{\left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) - \left(x \cdot y\right) \cdot \left(x \cdot y\right)}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + x \cdot y}} \cdot y + x \]
              5. clear-numN/A

                \[\leadsto \frac{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + x \cdot y}{\left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) - \left(x \cdot y\right) \cdot \left(x \cdot y\right)} \cdot y + x \]
              6. accelerator-lowering-fma.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\left(\frac{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + x \cdot y}{\left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot e^{z}\right) - \left(x \cdot y\right) \cdot \left(x \cdot y\right)}\right), \color{blue}{y}, x\right) \]
            4. Applied egg-rr99.7%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}, y, x\right)} \]
            5. Taylor expanded in z around 0

              \[\leadsto \color{blue}{x + -1 \cdot \frac{y}{x \cdot y - \frac{5641895835477563}{5000000000000000}}} \]
            6. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto x + \left(\mathsf{neg}\left(\frac{y}{x \cdot y - \frac{5641895835477563}{5000000000000000}}\right)\right) \]
              2. unsub-negN/A

                \[\leadsto x - \color{blue}{\frac{y}{x \cdot y - \frac{5641895835477563}{5000000000000000}}} \]
              3. --lowering--.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\frac{y}{x \cdot y - \frac{5641895835477563}{5000000000000000}}\right)}\right) \]
              4. /-lowering-/.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot y - \frac{5641895835477563}{5000000000000000}\right)}\right)\right) \]
              5. sub-negN/A

                \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{/.f64}\left(y, \left(x \cdot y + \color{blue}{\left(\mathsf{neg}\left(\frac{5641895835477563}{5000000000000000}\right)\right)}\right)\right)\right) \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{/.f64}\left(y, \left(y \cdot x + \left(\mathsf{neg}\left(\color{blue}{\frac{5641895835477563}{5000000000000000}}\right)\right)\right)\right)\right) \]
              7. metadata-evalN/A

                \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{/.f64}\left(y, \left(y \cdot x + \frac{-5641895835477563}{5000000000000000}\right)\right)\right) \]
              8. accelerator-lowering-fma.f6499.0%

                \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{fma.f64}\left(y, \color{blue}{x}, \frac{-5641895835477563}{5000000000000000}\right)\right)\right) \]
            7. Simplified99.0%

              \[\leadsto \color{blue}{x - \frac{y}{\mathsf{fma}\left(y, x, -1.1283791670955126\right)}} \]

            if 9 < z

            1. Initial program 93.3%

              \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x} \]
            4. Step-by-step derivation
              1. Simplified100.0%

                \[\leadsto \color{blue}{x} \]
            5. Recombined 3 regimes into one program.
            6. Add Preprocessing

            Alternative 8: 71.4% accurate, 4.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-37}:\\ \;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= x -4.3e-21)
               x
               (if (<= x 2.9e-37)
                 (fma 0.8862269254527579 y x)
                 (if (<= x 4.2e-8) (/ -1.0 x) x))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (x <= -4.3e-21) {
            		tmp = x;
            	} else if (x <= 2.9e-37) {
            		tmp = fma(0.8862269254527579, y, x);
            	} else if (x <= 4.2e-8) {
            		tmp = -1.0 / x;
            	} else {
            		tmp = x;
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if (x <= -4.3e-21)
            		tmp = x;
            	elseif (x <= 2.9e-37)
            		tmp = fma(0.8862269254527579, y, x);
            	elseif (x <= 4.2e-8)
            		tmp = Float64(-1.0 / x);
            	else
            		tmp = x;
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[LessEqual[x, -4.3e-21], x, If[LessEqual[x, 2.9e-37], N[(0.8862269254527579 * y + x), $MachinePrecision], If[LessEqual[x, 4.2e-8], N[(-1.0 / x), $MachinePrecision], x]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -4.3 \cdot 10^{-21}:\\
            \;\;\;\;x\\
            
            \mathbf{elif}\;x \leq 2.9 \cdot 10^{-37}:\\
            \;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\
            
            \mathbf{elif}\;x \leq 4.2 \cdot 10^{-8}:\\
            \;\;\;\;\frac{-1}{x}\\
            
            \mathbf{else}:\\
            \;\;\;\;x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if x < -4.2999999999999998e-21 or 4.19999999999999989e-8 < x

              1. Initial program 97.1%

                \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
              2. Add Preprocessing
              3. Taylor expanded in x around inf

                \[\leadsto \color{blue}{x} \]
              4. Step-by-step derivation
                1. Simplified98.0%

                  \[\leadsto \color{blue}{x} \]

                if -4.2999999999999998e-21 < x < 2.90000000000000005e-37

                1. Initial program 97.0%

                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

                  \[\leadsto \color{blue}{x + \frac{y}{\frac{5641895835477563}{5000000000000000} - x \cdot y}} \]
                4. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\frac{y}{\frac{5641895835477563}{5000000000000000} - x \cdot y}\right)}\right) \]
                  2. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \color{blue}{\left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \color{blue}{\left(x \cdot y\right)}\right)\right)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \left(y \cdot \color{blue}{x}\right)\right)\right)\right) \]
                  5. *-lowering-*.f6473.4%

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \mathsf{*.f64}\left(y, \color{blue}{x}\right)\right)\right)\right) \]
                5. Simplified73.4%

                  \[\leadsto \color{blue}{x + \frac{y}{1.1283791670955126 - y \cdot x}} \]
                6. Taylor expanded in y around 0

                  \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot y} \]
                7. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \frac{5000000000000000}{5641895835477563} \cdot y + \color{blue}{x} \]
                  2. accelerator-lowering-fma.f6454.8%

                    \[\leadsto \mathsf{fma.f64}\left(\frac{5000000000000000}{5641895835477563}, \color{blue}{y}, x\right) \]
                8. Simplified54.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(0.8862269254527579, y, x\right)} \]

                if 2.90000000000000005e-37 < x < 4.19999999999999989e-8

                1. Initial program 99.7%

                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in y around inf

                  \[\leadsto \color{blue}{x - \frac{1}{x}} \]
                4. Step-by-step derivation
                  1. sub-negN/A

                    \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)}\right) \]
                  3. distribute-neg-fracN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{\color{blue}{x}}\right)\right) \]
                  4. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{-1}{x}\right)\right) \]
                  5. /-lowering-/.f64100.0%

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{x}\right)\right) \]
                5. Simplified100.0%

                  \[\leadsto \color{blue}{x + \frac{-1}{x}} \]
                6. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\frac{-1}{x}} \]
                7. Step-by-step derivation
                  1. /-lowering-/.f64100.0%

                    \[\leadsto \mathsf{/.f64}\left(-1, \color{blue}{x}\right) \]
                8. Simplified100.0%

                  \[\leadsto \color{blue}{\frac{-1}{x}} \]
              5. Recombined 3 regimes into one program.
              6. Add Preprocessing

              Alternative 9: 86.4% accurate, 6.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.004:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-13}:\\ \;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= z -0.004)
                 (+ x (/ -1.0 x))
                 (if (<= z 1.7e-13) (fma 0.8862269254527579 y x) x)))
              double code(double x, double y, double z) {
              	double tmp;
              	if (z <= -0.004) {
              		tmp = x + (-1.0 / x);
              	} else if (z <= 1.7e-13) {
              		tmp = fma(0.8862269254527579, y, x);
              	} else {
              		tmp = x;
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if (z <= -0.004)
              		tmp = Float64(x + Float64(-1.0 / x));
              	elseif (z <= 1.7e-13)
              		tmp = fma(0.8862269254527579, y, x);
              	else
              		tmp = x;
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[LessEqual[z, -0.004], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-13], N[(0.8862269254527579 * y + x), $MachinePrecision], x]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -0.004:\\
              \;\;\;\;x + \frac{-1}{x}\\
              
              \mathbf{elif}\;z \leq 1.7 \cdot 10^{-13}:\\
              \;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if z < -0.0040000000000000001

                1. Initial program 94.2%

                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in y around inf

                  \[\leadsto \color{blue}{x - \frac{1}{x}} \]
                4. Step-by-step derivation
                  1. sub-negN/A

                    \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{x}\right)\right)}\right) \]
                  3. distribute-neg-fracN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{\color{blue}{x}}\right)\right) \]
                  4. metadata-evalN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{-1}{x}\right)\right) \]
                  5. /-lowering-/.f64100.0%

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{x}\right)\right) \]
                5. Simplified100.0%

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

                if -0.0040000000000000001 < z < 1.70000000000000008e-13

                1. Initial program 99.8%

                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

                  \[\leadsto \color{blue}{x + \frac{y}{\frac{5641895835477563}{5000000000000000} - x \cdot y}} \]
                4. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\frac{y}{\frac{5641895835477563}{5000000000000000} - x \cdot y}\right)}\right) \]
                  2. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \color{blue}{\left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \color{blue}{\left(x \cdot y\right)}\right)\right)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \left(y \cdot \color{blue}{x}\right)\right)\right)\right) \]
                  5. *-lowering-*.f6498.9%

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \mathsf{*.f64}\left(y, \color{blue}{x}\right)\right)\right)\right) \]
                5. Simplified98.9%

                  \[\leadsto \color{blue}{x + \frac{y}{1.1283791670955126 - y \cdot x}} \]
                6. Taylor expanded in y around 0

                  \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot y} \]
                7. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \frac{5000000000000000}{5641895835477563} \cdot y + \color{blue}{x} \]
                  2. accelerator-lowering-fma.f6475.9%

                    \[\leadsto \mathsf{fma.f64}\left(\frac{5000000000000000}{5641895835477563}, \color{blue}{y}, x\right) \]
                8. Simplified75.9%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(0.8862269254527579, y, x\right)} \]

                if 1.70000000000000008e-13 < z

                1. Initial program 93.3%

                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{x} \]
                4. Step-by-step derivation
                  1. Simplified100.0%

                    \[\leadsto \color{blue}{x} \]
                5. Recombined 3 regimes into one program.
                6. Add Preprocessing

                Alternative 10: 71.5% accurate, 6.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 8.4 \cdot 10^{-16}:\\ \;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= x -1.75e-21) x (if (<= x 8.4e-16) (fma 0.8862269254527579 y x) x)))
                double code(double x, double y, double z) {
                	double tmp;
                	if (x <= -1.75e-21) {
                		tmp = x;
                	} else if (x <= 8.4e-16) {
                		tmp = fma(0.8862269254527579, y, x);
                	} else {
                		tmp = x;
                	}
                	return tmp;
                }
                
                function code(x, y, z)
                	tmp = 0.0
                	if (x <= -1.75e-21)
                		tmp = x;
                	elseif (x <= 8.4e-16)
                		tmp = fma(0.8862269254527579, y, x);
                	else
                		tmp = x;
                	end
                	return tmp
                end
                
                code[x_, y_, z_] := If[LessEqual[x, -1.75e-21], x, If[LessEqual[x, 8.4e-16], N[(0.8862269254527579 * y + x), $MachinePrecision], x]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \leq -1.75 \cdot 10^{-21}:\\
                \;\;\;\;x\\
                
                \mathbf{elif}\;x \leq 8.4 \cdot 10^{-16}:\\
                \;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -1.7500000000000002e-21 or 8.4000000000000004e-16 < x

                  1. Initial program 97.1%

                    \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around inf

                    \[\leadsto \color{blue}{x} \]
                  4. Step-by-step derivation
                    1. Simplified97.3%

                      \[\leadsto \color{blue}{x} \]

                    if -1.7500000000000002e-21 < x < 8.4000000000000004e-16

                    1. Initial program 97.2%

                      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                    2. Add Preprocessing
                    3. Taylor expanded in z around 0

                      \[\leadsto \color{blue}{x + \frac{y}{\frac{5641895835477563}{5000000000000000} - x \cdot y}} \]
                    4. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\frac{y}{\frac{5641895835477563}{5000000000000000} - x \cdot y}\right)}\right) \]
                      2. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \color{blue}{\left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)}\right)\right) \]
                      3. --lowering--.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \color{blue}{\left(x \cdot y\right)}\right)\right)\right) \]
                      4. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \left(y \cdot \color{blue}{x}\right)\right)\right)\right) \]
                      5. *-lowering-*.f6472.8%

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \mathsf{*.f64}\left(y, \color{blue}{x}\right)\right)\right)\right) \]
                    5. Simplified72.8%

                      \[\leadsto \color{blue}{x + \frac{y}{1.1283791670955126 - y \cdot x}} \]
                    6. Taylor expanded in y around 0

                      \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot y} \]
                    7. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \frac{5000000000000000}{5641895835477563} \cdot y + \color{blue}{x} \]
                      2. accelerator-lowering-fma.f6452.6%

                        \[\leadsto \mathsf{fma.f64}\left(\frac{5000000000000000}{5641895835477563}, \color{blue}{y}, x\right) \]
                    8. Simplified52.6%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(0.8862269254527579, y, x\right)} \]
                  5. Recombined 2 regimes into one program.
                  6. Add Preprocessing

                  Alternative 11: 70.3% accurate, 7.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{-193}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-248}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (if (<= x -8.5e-193) x (if (<= x 4.5e-248) (* y 0.8862269254527579) x)))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (x <= -8.5e-193) {
                  		tmp = x;
                  	} else if (x <= 4.5e-248) {
                  		tmp = y * 0.8862269254527579;
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8) :: tmp
                      if (x <= (-8.5d-193)) then
                          tmp = x
                      else if (x <= 4.5d-248) then
                          tmp = y * 0.8862269254527579d0
                      else
                          tmp = x
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double tmp;
                  	if (x <= -8.5e-193) {
                  		tmp = x;
                  	} else if (x <= 4.5e-248) {
                  		tmp = y * 0.8862269254527579;
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if x <= -8.5e-193:
                  		tmp = x
                  	elif x <= 4.5e-248:
                  		tmp = y * 0.8862269254527579
                  	else:
                  		tmp = x
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (x <= -8.5e-193)
                  		tmp = x;
                  	elseif (x <= 4.5e-248)
                  		tmp = Float64(y * 0.8862269254527579);
                  	else
                  		tmp = x;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if (x <= -8.5e-193)
                  		tmp = x;
                  	elseif (x <= 4.5e-248)
                  		tmp = y * 0.8862269254527579;
                  	else
                  		tmp = x;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[x, -8.5e-193], x, If[LessEqual[x, 4.5e-248], N[(y * 0.8862269254527579), $MachinePrecision], x]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;x \leq -8.5 \cdot 10^{-193}:\\
                  \;\;\;\;x\\
                  
                  \mathbf{elif}\;x \leq 4.5 \cdot 10^{-248}:\\
                  \;\;\;\;y \cdot 0.8862269254527579\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < -8.50000000000000004e-193 or 4.4999999999999996e-248 < x

                    1. Initial program 97.6%

                      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                    2. Add Preprocessing
                    3. Taylor expanded in x around inf

                      \[\leadsto \color{blue}{x} \]
                    4. Step-by-step derivation
                      1. Simplified77.9%

                        \[\leadsto \color{blue}{x} \]

                      if -8.50000000000000004e-193 < x < 4.4999999999999996e-248

                      1. Initial program 95.2%

                        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                      2. Add Preprocessing
                      3. Taylor expanded in z around 0

                        \[\leadsto \color{blue}{x + \frac{y}{\frac{5641895835477563}{5000000000000000} - x \cdot y}} \]
                      4. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(\frac{y}{\frac{5641895835477563}{5000000000000000} - x \cdot y}\right)}\right) \]
                        2. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \color{blue}{\left(\frac{5641895835477563}{5000000000000000} - x \cdot y\right)}\right)\right) \]
                        3. --lowering--.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \color{blue}{\left(x \cdot y\right)}\right)\right)\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \left(y \cdot \color{blue}{x}\right)\right)\right)\right) \]
                        5. *-lowering-*.f6466.3%

                          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(\frac{5641895835477563}{5000000000000000}, \mathsf{*.f64}\left(y, \color{blue}{x}\right)\right)\right)\right) \]
                      5. Simplified66.3%

                        \[\leadsto \color{blue}{x + \frac{y}{1.1283791670955126 - y \cdot x}} \]
                      6. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot y} \]
                      7. Step-by-step derivation
                        1. *-lowering-*.f6456.6%

                          \[\leadsto \mathsf{*.f64}\left(\frac{5000000000000000}{5641895835477563}, \color{blue}{y}\right) \]
                      8. Simplified56.6%

                        \[\leadsto \color{blue}{0.8862269254527579 \cdot y} \]
                    5. Recombined 2 regimes into one program.
                    6. Final simplification74.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{-193}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-248}:\\ \;\;\;\;y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 12: 69.3% accurate, 128.0× speedup?

                    \[\begin{array}{l} \\ x \end{array} \]
                    (FPCore (x y z) :precision binary64 x)
                    double code(double x, double y, double z) {
                    	return x;
                    }
                    
                    real(8) function code(x, y, z)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        code = x
                    end function
                    
                    public static double code(double x, double y, double z) {
                    	return x;
                    }
                    
                    def code(x, y, z):
                    	return x
                    
                    function code(x, y, z)
                    	return x
                    end
                    
                    function tmp = code(x, y, z)
                    	tmp = x;
                    end
                    
                    code[x_, y_, z_] := x
                    
                    \begin{array}{l}
                    
                    \\
                    x
                    \end{array}
                    
                    Derivation
                    1. Initial program 97.1%

                      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                    2. Add Preprocessing
                    3. Taylor expanded in x around inf

                      \[\leadsto \color{blue}{x} \]
                    4. Step-by-step derivation
                      1. Simplified67.8%

                        \[\leadsto \color{blue}{x} \]
                      2. Add Preprocessing

                      Developer Target 1: 99.9% accurate, 1.0× speedup?

                      \[\begin{array}{l} \\ x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x} \end{array} \]
                      (FPCore (x y z)
                       :precision binary64
                       (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x))))
                      double code(double x, double y, double z) {
                      	return x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x));
                      }
                      
                      real(8) function code(x, y, z)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          code = x + (1.0d0 / (((1.1283791670955126d0 / y) * exp(z)) - x))
                      end function
                      
                      public static double code(double x, double y, double z) {
                      	return x + (1.0 / (((1.1283791670955126 / y) * Math.exp(z)) - x));
                      }
                      
                      def code(x, y, z):
                      	return x + (1.0 / (((1.1283791670955126 / y) * math.exp(z)) - x))
                      
                      function code(x, y, z)
                      	return Float64(x + Float64(1.0 / Float64(Float64(Float64(1.1283791670955126 / y) * exp(z)) - x)))
                      end
                      
                      function tmp = code(x, y, z)
                      	tmp = x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x));
                      end
                      
                      code[x_, y_, z_] := N[(x + N[(1.0 / N[(N[(N[(1.1283791670955126 / y), $MachinePrecision] * N[Exp[z], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x}
                      \end{array}
                      

                      Reproduce

                      ?
                      herbie shell --seed 2024193 
                      (FPCore (x y z)
                        :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
                        :precision binary64
                      
                        :alt
                        (! :herbie-platform default (+ x (/ 1 (- (* (/ 5641895835477563/5000000000000000 y) (exp z)) x))))
                      
                        (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))