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

Percentage Accurate: 95.7% → 99.3%
Time: 10.6s
Alternatives: 11
Speedup: 0.5×

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 11 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.7% 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.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;e^{z} \leq 1:\\ \;\;\;\;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 (<= (exp z) 0.0)
   (+ x (/ -1.0 x))
   (if (<= (exp z) 1.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 (exp(z) <= 0.0) {
		tmp = x + (-1.0 / x);
	} else if (exp(z) <= 1.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 (exp(z) <= 0.0)
		tmp = Float64(x + Float64(-1.0 / x));
	elseif (exp(z) <= 1.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[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Exp[z], $MachinePrecision], 1.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}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\

\mathbf{elif}\;e^{z} \leq 1:\\
\;\;\;\;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 (exp.f64 z) < 0.0

    1. Initial program 84.4%

      \[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 \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
      2. +-lowering-+.f64N/A

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

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

        \[\leadsto x + \frac{\color{blue}{-1}}{x} \]
      5. /-lowering-/.f64100.0

        \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
    5. Simplified100.0%

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

    if 0.0 < (exp.f64 z) < 1

    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 x + \frac{y}{\color{blue}{\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}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot \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)}} \]
      3. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto 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 - \color{blue}{y \cdot x}\right)} \]
    5. Simplified99.7%

      \[\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 1 < (exp.f64 z)

    1. Initial program 96.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. Simplified100.0%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;e^{z} \leq 1:\\ \;\;\;\;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: 86.6% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \frac{-1}{x}\\ t_1 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-25}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-223}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_1 \leq 0.05:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(1.1283791670955126, z, 1.1283791670955126\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (+ x (/ -1.0 x)))
            (t_1 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y))))))
       (if (<= t_1 -2e-25)
         t_0
         (if (<= t_1 2e-223)
           x
           (if (<= t_1 0.05)
             (+ x (/ y (fma 1.1283791670955126 z 1.1283791670955126)))
             t_0)))))
    double code(double x, double y, double z) {
    	double t_0 = x + (-1.0 / x);
    	double t_1 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
    	double tmp;
    	if (t_1 <= -2e-25) {
    		tmp = t_0;
    	} else if (t_1 <= 2e-223) {
    		tmp = x;
    	} else if (t_1 <= 0.05) {
    		tmp = x + (y / fma(1.1283791670955126, z, 1.1283791670955126));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	t_0 = Float64(x + Float64(-1.0 / x))
    	t_1 = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y))))
    	tmp = 0.0
    	if (t_1 <= -2e-25)
    		tmp = t_0;
    	elseif (t_1 <= 2e-223)
    		tmp = x;
    	elseif (t_1 <= 0.05)
    		tmp = Float64(x + Float64(y / fma(1.1283791670955126, z, 1.1283791670955126)));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-25], t$95$0, If[LessEqual[t$95$1, 2e-223], x, If[LessEqual[t$95$1, 0.05], N[(x + N[(y / N[(1.1283791670955126 * z + 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x + \frac{-1}{x}\\
    t_1 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-25}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-223}:\\
    \;\;\;\;x\\
    
    \mathbf{elif}\;t\_1 \leq 0.05:\\
    \;\;\;\;x + \frac{y}{\mathsf{fma}\left(1.1283791670955126, z, 1.1283791670955126\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < -2.00000000000000008e-25 or 0.050000000000000003 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y))))

      1. Initial program 93.5%

        \[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 \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
        2. +-lowering-+.f64N/A

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

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

          \[\leadsto x + \frac{\color{blue}{-1}}{x} \]
        5. /-lowering-/.f6491.9

          \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
      5. Simplified91.9%

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

      if -2.00000000000000008e-25 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 1.9999999999999999e-223

      1. Initial program 100.0%

        \[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. Simplified90.5%

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

        if 1.9999999999999999e-223 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 0.050000000000000003

        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 x + \frac{y}{\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right) - x \cdot y}} \]
        4. Step-by-step derivation
          1. sub-negN/A

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \color{blue}{z \cdot \frac{5641895835477563}{5000000000000000}} + \frac{5641895835477563}{5000000000000000}\right)} \]
          11. accelerator-lowering-fma.f6494.7

            \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \color{blue}{\mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right)}\right)} \]
        5. Simplified94.7%

          \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right)\right)}} \]
        6. Taylor expanded in y around 0

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

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

            \[\leadsto x + \color{blue}{\frac{y}{\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z}} \]
          3. +-commutativeN/A

            \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000} \cdot z + \frac{5641895835477563}{5000000000000000}}} \]
          4. accelerator-lowering-fma.f6494.6

            \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(1.1283791670955126, z, 1.1283791670955126\right)}} \]
        8. Simplified94.6%

          \[\leadsto \color{blue}{x + \frac{y}{\mathsf{fma}\left(1.1283791670955126, z, 1.1283791670955126\right)}} \]
      5. Recombined 3 regimes into one program.
      6. Final simplification92.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y} \leq -2 \cdot 10^{-25}:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y} \leq 2 \cdot 10^{-223}:\\ \;\;\;\;x\\ \mathbf{elif}\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y} \leq 0.05:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(1.1283791670955126, z, 1.1283791670955126\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{-1}{x}\\ \end{array} \]
      7. Add Preprocessing

      Alternative 3: 86.3% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \frac{-1}{x}\\ t_1 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-25}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-85}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_1 \leq 0.05:\\ \;\;\;\;x + y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (+ x (/ -1.0 x)))
              (t_1 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y))))))
         (if (<= t_1 -2e-25)
           t_0
           (if (<= t_1 5e-85)
             x
             (if (<= t_1 0.05) (+ x (* y 0.8862269254527579)) t_0)))))
      double code(double x, double y, double z) {
      	double t_0 = x + (-1.0 / x);
      	double t_1 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
      	double tmp;
      	if (t_1 <= -2e-25) {
      		tmp = t_0;
      	} else if (t_1 <= 5e-85) {
      		tmp = x;
      	} else if (t_1 <= 0.05) {
      		tmp = x + (y * 0.8862269254527579);
      	} else {
      		tmp = t_0;
      	}
      	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) :: t_1
          real(8) :: tmp
          t_0 = x + ((-1.0d0) / x)
          t_1 = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
          if (t_1 <= (-2d-25)) then
              tmp = t_0
          else if (t_1 <= 5d-85) then
              tmp = x
          else if (t_1 <= 0.05d0) then
              tmp = x + (y * 0.8862269254527579d0)
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = x + (-1.0 / x);
      	double t_1 = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
      	double tmp;
      	if (t_1 <= -2e-25) {
      		tmp = t_0;
      	} else if (t_1 <= 5e-85) {
      		tmp = x;
      	} else if (t_1 <= 0.05) {
      		tmp = x + (y * 0.8862269254527579);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = x + (-1.0 / x)
      	t_1 = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y)))
      	tmp = 0
      	if t_1 <= -2e-25:
      		tmp = t_0
      	elif t_1 <= 5e-85:
      		tmp = x
      	elif t_1 <= 0.05:
      		tmp = x + (y * 0.8862269254527579)
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(x + Float64(-1.0 / x))
      	t_1 = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y))))
      	tmp = 0.0
      	if (t_1 <= -2e-25)
      		tmp = t_0;
      	elseif (t_1 <= 5e-85)
      		tmp = x;
      	elseif (t_1 <= 0.05)
      		tmp = Float64(x + Float64(y * 0.8862269254527579));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = x + (-1.0 / x);
      	t_1 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
      	tmp = 0.0;
      	if (t_1 <= -2e-25)
      		tmp = t_0;
      	elseif (t_1 <= 5e-85)
      		tmp = x;
      	elseif (t_1 <= 0.05)
      		tmp = x + (y * 0.8862269254527579);
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-25], t$95$0, If[LessEqual[t$95$1, 5e-85], x, If[LessEqual[t$95$1, 0.05], N[(x + N[(y * 0.8862269254527579), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x + \frac{-1}{x}\\
      t_1 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
      \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-25}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-85}:\\
      \;\;\;\;x\\
      
      \mathbf{elif}\;t\_1 \leq 0.05:\\
      \;\;\;\;x + y \cdot 0.8862269254527579\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < -2.00000000000000008e-25 or 0.050000000000000003 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y))))

        1. Initial program 93.5%

          \[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 \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
          2. +-lowering-+.f64N/A

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

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

            \[\leadsto x + \frac{\color{blue}{-1}}{x} \]
          5. /-lowering-/.f6491.9

            \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
        5. Simplified91.9%

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

        if -2.00000000000000008e-25 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 5.0000000000000002e-85

        1. Initial program 99.9%

          \[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. Simplified87.8%

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

          if 5.0000000000000002e-85 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 0.050000000000000003

          1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{5641895835477563}{10000000000000000}} + \frac{5641895835477563}{5000000000000000}, \frac{5641895835477563}{5000000000000000}\right)\right)} \]
            13. accelerator-lowering-fma.f6494.3

              \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right)}, 1.1283791670955126\right)\right)} \]
          5. Simplified94.3%

            \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right)\right)}} \]
          6. Taylor expanded in z around 0

            \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \color{blue}{\frac{5641895835477563}{5000000000000000}}\right)} \]
          7. Step-by-step derivation
            1. Simplified88.8%

              \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \color{blue}{1.1283791670955126}\right)} \]
            2. Taylor expanded in y around 0

              \[\leadsto x + \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot y} \]
            3. Step-by-step derivation
              1. *-lowering-*.f6489.1

                \[\leadsto x + \color{blue}{0.8862269254527579 \cdot y} \]
            4. Simplified89.1%

              \[\leadsto x + \color{blue}{0.8862269254527579 \cdot y} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification90.9%

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

          Alternative 4: 99.3% accurate, 0.5× speedup?

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

            1. Initial program 84.4%

              \[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 \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
              2. +-lowering-+.f64N/A

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

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

                \[\leadsto x + \frac{\color{blue}{-1}}{x} \]
              5. /-lowering-/.f64100.0

                \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
            5. Simplified100.0%

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

            if 0.0 < (exp.f64 z) < 1

            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 x + \frac{y}{\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right)\right) - x \cdot y}} \]
            4. Step-by-step derivation
              1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{5641895835477563}{10000000000000000}} + \frac{5641895835477563}{5000000000000000}, \frac{5641895835477563}{5000000000000000}\right)\right)} \]
              13. accelerator-lowering-fma.f6499.6

                \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right)}, 1.1283791670955126\right)\right)} \]
            5. Simplified99.6%

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

            if 1 < (exp.f64 z)

            1. Initial program 96.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. Simplified100.0%

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

            Alternative 5: 99.3% accurate, 0.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;e^{z} \leq 1:\\ \;\;\;\;x + \frac{y}{\mathsf{fma}\left(y, -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 (<= (exp z) 0.0)
               (+ x (/ -1.0 x))
               (if (<= (exp z) 1.0)
                 (+ x (/ y (fma y (- x) (fma z 1.1283791670955126 1.1283791670955126))))
                 x)))
            double code(double x, double y, double z) {
            	double tmp;
            	if (exp(z) <= 0.0) {
            		tmp = x + (-1.0 / x);
            	} else if (exp(z) <= 1.0) {
            		tmp = x + (y / fma(y, -x, fma(z, 1.1283791670955126, 1.1283791670955126)));
            	} else {
            		tmp = x;
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if (exp(z) <= 0.0)
            		tmp = Float64(x + Float64(-1.0 / x));
            	elseif (exp(z) <= 1.0)
            		tmp = Float64(x + Float64(y / fma(y, Float64(-x), fma(z, 1.1283791670955126, 1.1283791670955126))));
            	else
            		tmp = x;
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Exp[z], $MachinePrecision], 1.0], N[(x + N[(y / N[(y * (-x) + N[(z * 1.1283791670955126 + 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;e^{z} \leq 0:\\
            \;\;\;\;x + \frac{-1}{x}\\
            
            \mathbf{elif}\;e^{z} \leq 1:\\
            \;\;\;\;x + \frac{y}{\mathsf{fma}\left(y, -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 (exp.f64 z) < 0.0

              1. Initial program 84.4%

                \[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 \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
                2. +-lowering-+.f64N/A

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

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

                  \[\leadsto x + \frac{\color{blue}{-1}}{x} \]
                5. /-lowering-/.f64100.0

                  \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
              5. Simplified100.0%

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

              if 0.0 < (exp.f64 z) < 1

              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 x + \frac{y}{\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right) - x \cdot y}} \]
              4. Step-by-step derivation
                1. sub-negN/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \color{blue}{z \cdot \frac{5641895835477563}{5000000000000000}} + \frac{5641895835477563}{5000000000000000}\right)} \]
                11. accelerator-lowering-fma.f6499.4

                  \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \color{blue}{\mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right)}\right)} \]
              5. Simplified99.4%

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

              if 1 < (exp.f64 z)

              1. Initial program 96.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. Simplified100.0%

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

              Alternative 6: 98.6% accurate, 0.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \leq 0:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= (exp z) 0.0)
                 (+ x (/ -1.0 x))
                 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y))))))
              double code(double x, double y, double z) {
              	double tmp;
              	if (exp(z) <= 0.0) {
              		tmp = x + (-1.0 / x);
              	} else {
              		tmp = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
              	}
              	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 (exp(z) <= 0.0d0) then
                      tmp = x + ((-1.0d0) / x)
                  else
                      tmp = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z) {
              	double tmp;
              	if (Math.exp(z) <= 0.0) {
              		tmp = x + (-1.0 / x);
              	} else {
              		tmp = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
              	}
              	return tmp;
              }
              
              def code(x, y, z):
              	tmp = 0
              	if math.exp(z) <= 0.0:
              		tmp = x + (-1.0 / x)
              	else:
              		tmp = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y)))
              	return tmp
              
              function code(x, y, z)
              	tmp = 0.0
              	if (exp(z) <= 0.0)
              		tmp = Float64(x + Float64(-1.0 / x));
              	else
              		tmp = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z)
              	tmp = 0.0;
              	if (exp(z) <= 0.0)
              		tmp = x + (-1.0 / x);
              	else
              		tmp = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;e^{z} \leq 0:\\
              \;\;\;\;x + \frac{-1}{x}\\
              
              \mathbf{else}:\\
              \;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (exp.f64 z) < 0.0

                1. Initial program 84.4%

                  \[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 \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
                  2. +-lowering-+.f64N/A

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

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

                    \[\leadsto x + \frac{\color{blue}{-1}}{x} \]
                  5. /-lowering-/.f64100.0

                    \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
                5. Simplified100.0%

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

                if 0.0 < (exp.f64 z)

                1. Initial program 98.4%

                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                2. Add Preprocessing
              3. Recombined 2 regimes into one program.
              4. Final simplification98.7%

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

              Alternative 7: 99.2% accurate, 0.5× speedup?

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

                1. Initial program 84.4%

                  \[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 \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)} \]
                  2. +-lowering-+.f64N/A

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

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

                    \[\leadsto x + \frac{\color{blue}{-1}}{x} \]
                  5. /-lowering-/.f64100.0

                    \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
                5. Simplified100.0%

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

                if 0.0 < (exp.f64 z) < 1

                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 x + \frac{y}{\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right)\right) - x \cdot y}} \]
                4. Step-by-step derivation
                  1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{5641895835477563}{10000000000000000}} + \frac{5641895835477563}{5000000000000000}, \frac{5641895835477563}{5000000000000000}\right)\right)} \]
                  13. accelerator-lowering-fma.f6499.6

                    \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right)}, 1.1283791670955126\right)\right)} \]
                5. Simplified99.6%

                  \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right)\right)}} \]
                6. Taylor expanded in z around 0

                  \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \color{blue}{\frac{5641895835477563}{5000000000000000}}\right)} \]
                7. Step-by-step derivation
                  1. Simplified99.2%

                    \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \color{blue}{1.1283791670955126}\right)} \]
                  2. Step-by-step derivation
                    1. frac-2negN/A

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

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

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

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

                      \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\frac{y}{y \cdot \left(\mathsf{neg}\left(x\right)\right) + \frac{5641895835477563}{5000000000000000}}\right)\right)} \]
                    6. distribute-frac-neg2N/A

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

                      \[\leadsto x - \color{blue}{\frac{y}{\mathsf{neg}\left(\left(y \cdot \left(\mathsf{neg}\left(x\right)\right) + \frac{5641895835477563}{5000000000000000}\right)\right)}} \]
                    8. distribute-neg-inN/A

                      \[\leadsto x - \frac{y}{\color{blue}{\left(\mathsf{neg}\left(y \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right) + \left(\mathsf{neg}\left(\frac{5641895835477563}{5000000000000000}\right)\right)}} \]
                    9. distribute-rgt-neg-outN/A

                      \[\leadsto x - \frac{y}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(y \cdot x\right)\right)}\right)\right) + \left(\mathsf{neg}\left(\frac{5641895835477563}{5000000000000000}\right)\right)} \]
                    10. remove-double-negN/A

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

                      \[\leadsto x - \frac{y}{\color{blue}{x \cdot y} + \left(\mathsf{neg}\left(\frac{5641895835477563}{5000000000000000}\right)\right)} \]
                    12. accelerator-lowering-fma.f64N/A

                      \[\leadsto x - \frac{y}{\color{blue}{\mathsf{fma}\left(x, y, \mathsf{neg}\left(\frac{5641895835477563}{5000000000000000}\right)\right)}} \]
                    13. metadata-eval99.2

                      \[\leadsto x - \frac{y}{\mathsf{fma}\left(x, y, \color{blue}{-1.1283791670955126}\right)} \]
                  3. Applied egg-rr99.2%

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

                  if 1 < (exp.f64 z)

                  1. Initial program 96.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. Simplified100.0%

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

                  Alternative 8: 74.7% accurate, 4.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+207}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;z \leq -1.32 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-31}:\\ \;\;\;\;x + y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (if (<= z -7e+207)
                     (/ -1.0 x)
                     (if (<= z -1.32e-18)
                       x
                       (if (<= z 2.6e-31) (+ x (* y 0.8862269254527579)) x))))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= -7e+207) {
                  		tmp = -1.0 / x;
                  	} else if (z <= -1.32e-18) {
                  		tmp = x;
                  	} else if (z <= 2.6e-31) {
                  		tmp = x + (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 (z <= (-7d+207)) then
                          tmp = (-1.0d0) / x
                      else if (z <= (-1.32d-18)) then
                          tmp = x
                      else if (z <= 2.6d-31) then
                          tmp = x + (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 (z <= -7e+207) {
                  		tmp = -1.0 / x;
                  	} else if (z <= -1.32e-18) {
                  		tmp = x;
                  	} else if (z <= 2.6e-31) {
                  		tmp = x + (y * 0.8862269254527579);
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if z <= -7e+207:
                  		tmp = -1.0 / x
                  	elif z <= -1.32e-18:
                  		tmp = x
                  	elif z <= 2.6e-31:
                  		tmp = x + (y * 0.8862269254527579)
                  	else:
                  		tmp = x
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (z <= -7e+207)
                  		tmp = Float64(-1.0 / x);
                  	elseif (z <= -1.32e-18)
                  		tmp = x;
                  	elseif (z <= 2.6e-31)
                  		tmp = Float64(x + Float64(y * 0.8862269254527579));
                  	else
                  		tmp = x;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if (z <= -7e+207)
                  		tmp = -1.0 / x;
                  	elseif (z <= -1.32e-18)
                  		tmp = x;
                  	elseif (z <= 2.6e-31)
                  		tmp = x + (y * 0.8862269254527579);
                  	else
                  		tmp = x;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[z, -7e+207], N[(-1.0 / x), $MachinePrecision], If[LessEqual[z, -1.32e-18], x, If[LessEqual[z, 2.6e-31], N[(x + N[(y * 0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -7 \cdot 10^{+207}:\\
                  \;\;\;\;\frac{-1}{x}\\
                  
                  \mathbf{elif}\;z \leq -1.32 \cdot 10^{-18}:\\
                  \;\;\;\;x\\
                  
                  \mathbf{elif}\;z \leq 2.6 \cdot 10^{-31}:\\
                  \;\;\;\;x + y \cdot 0.8862269254527579\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if z < -7.00000000000000056e207

                    1. Initial program 72.8%

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

                      \[\leadsto x + \frac{y}{\color{blue}{-1 \cdot \left(x \cdot y\right)}} \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto x + \frac{y}{\color{blue}{\left(-1 \cdot x\right) \cdot y}} \]
                      2. *-commutativeN/A

                        \[\leadsto x + \frac{y}{\color{blue}{y \cdot \left(-1 \cdot x\right)}} \]
                      3. *-lowering-*.f64N/A

                        \[\leadsto x + \frac{y}{\color{blue}{y \cdot \left(-1 \cdot x\right)}} \]
                      4. mul-1-negN/A

                        \[\leadsto x + \frac{y}{y \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}} \]
                      5. neg-lowering-neg.f6473.9

                        \[\leadsto x + \frac{y}{y \cdot \color{blue}{\left(-x\right)}} \]
                    5. Simplified73.9%

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

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

                        \[\leadsto \color{blue}{\frac{-1}{x}} \]
                    8. Simplified64.2%

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

                    if -7.00000000000000056e207 < z < -1.3199999999999999e-18 or 2.59999999999999995e-31 < z

                    1. Initial program 95.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. Simplified90.1%

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

                      if -1.3199999999999999e-18 < z < 2.59999999999999995e-31

                      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 x + \frac{y}{\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right)\right) - x \cdot y}} \]
                      4. Step-by-step derivation
                        1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{5641895835477563}{10000000000000000}} + \frac{5641895835477563}{5000000000000000}, \frac{5641895835477563}{5000000000000000}\right)\right)} \]
                        13. accelerator-lowering-fma.f6499.8

                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right)}, 1.1283791670955126\right)\right)} \]
                      5. Simplified99.8%

                        \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right)\right)}} \]
                      6. Taylor expanded in z around 0

                        \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \color{blue}{\frac{5641895835477563}{5000000000000000}}\right)} \]
                      7. Step-by-step derivation
                        1. Simplified99.8%

                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \color{blue}{1.1283791670955126}\right)} \]
                        2. Taylor expanded in y around 0

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

                            \[\leadsto x + \color{blue}{0.8862269254527579 \cdot y} \]
                        4. Simplified76.4%

                          \[\leadsto x + \color{blue}{0.8862269254527579 \cdot y} \]
                      8. Recombined 3 regimes into one program.
                      9. Final simplification82.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+207}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{elif}\;z \leq -1.32 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-31}:\\ \;\;\;\;x + y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 9: 74.2% accurate, 6.1× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-31}:\\ \;\;\;\;x + y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                      (FPCore (x y z)
                       :precision binary64
                       (if (<= z -1.55e-18) x (if (<= z 4e-31) (+ x (* y 0.8862269254527579)) x)))
                      double code(double x, double y, double z) {
                      	double tmp;
                      	if (z <= -1.55e-18) {
                      		tmp = x;
                      	} else if (z <= 4e-31) {
                      		tmp = x + (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 (z <= (-1.55d-18)) then
                              tmp = x
                          else if (z <= 4d-31) then
                              tmp = x + (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 (z <= -1.55e-18) {
                      		tmp = x;
                      	} else if (z <= 4e-31) {
                      		tmp = x + (y * 0.8862269254527579);
                      	} else {
                      		tmp = x;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z):
                      	tmp = 0
                      	if z <= -1.55e-18:
                      		tmp = x
                      	elif z <= 4e-31:
                      		tmp = x + (y * 0.8862269254527579)
                      	else:
                      		tmp = x
                      	return tmp
                      
                      function code(x, y, z)
                      	tmp = 0.0
                      	if (z <= -1.55e-18)
                      		tmp = x;
                      	elseif (z <= 4e-31)
                      		tmp = Float64(x + Float64(y * 0.8862269254527579));
                      	else
                      		tmp = x;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z)
                      	tmp = 0.0;
                      	if (z <= -1.55e-18)
                      		tmp = x;
                      	elseif (z <= 4e-31)
                      		tmp = x + (y * 0.8862269254527579);
                      	else
                      		tmp = x;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_] := If[LessEqual[z, -1.55e-18], x, If[LessEqual[z, 4e-31], N[(x + N[(y * 0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -1.55 \cdot 10^{-18}:\\
                      \;\;\;\;x\\
                      
                      \mathbf{elif}\;z \leq 4 \cdot 10^{-31}:\\
                      \;\;\;\;x + y \cdot 0.8862269254527579\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -1.55000000000000003e-18 or 4e-31 < z

                        1. Initial program 91.9%

                          \[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. Simplified81.8%

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

                          if -1.55000000000000003e-18 < z < 4e-31

                          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 x + \frac{y}{\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right)\right) - x \cdot y}} \]
                          4. Step-by-step derivation
                            1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{5641895835477563}{10000000000000000}} + \frac{5641895835477563}{5000000000000000}, \frac{5641895835477563}{5000000000000000}\right)\right)} \]
                            13. accelerator-lowering-fma.f6499.8

                              \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right)}, 1.1283791670955126\right)\right)} \]
                          5. Simplified99.8%

                            \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right)\right)}} \]
                          6. Taylor expanded in z around 0

                            \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \color{blue}{\frac{5641895835477563}{5000000000000000}}\right)} \]
                          7. Step-by-step derivation
                            1. Simplified99.8%

                              \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \color{blue}{1.1283791670955126}\right)} \]
                            2. Taylor expanded in y around 0

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

                                \[\leadsto x + \color{blue}{0.8862269254527579 \cdot y} \]
                            4. Simplified76.4%

                              \[\leadsto x + \color{blue}{0.8862269254527579 \cdot y} \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification79.5%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-31}:\\ \;\;\;\;x + y \cdot 0.8862269254527579\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 10: 74.2% accurate, 6.7× speedup?

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

                            1. Initial program 91.9%

                              \[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. Simplified81.8%

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

                              if -3.6000000000000001e-19 < z < 3.39999999999999978e-32

                              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 x + \frac{y}{\color{blue}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right)\right) - x \cdot y}} \]
                              4. Step-by-step derivation
                                1. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{5641895835477563}{10000000000000000}} + \frac{5641895835477563}{5000000000000000}, \frac{5641895835477563}{5000000000000000}\right)\right)} \]
                                13. accelerator-lowering-fma.f6499.8

                                  \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right)}, 1.1283791670955126\right)\right)} \]
                              5. Simplified99.8%

                                \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(y, -x, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right)\right)}} \]
                              6. Taylor expanded in z around 0

                                \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, \mathsf{neg}\left(x\right), \color{blue}{\frac{5641895835477563}{5000000000000000}}\right)} \]
                              7. Step-by-step derivation
                                1. Simplified99.8%

                                  \[\leadsto x + \frac{y}{\mathsf{fma}\left(y, -x, \color{blue}{1.1283791670955126}\right)} \]
                                2. Taylor expanded in y around 0

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

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(0.8862269254527579, y, x\right)} \]
                                4. Simplified76.3%

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

                              Alternative 11: 68.8% 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 95.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. Simplified73.6%

                                  \[\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 2024205 
                                (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)))))