Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3

Percentage Accurate: 87.8% → 99.4%
Time: 8.6s
Alternatives: 9
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
	return (x * ((y - z) + 1.0)) / z;
}
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 - z) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
	return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z):
	return (x * ((y - z) + 1.0)) / z
function code(x, y, z)
	return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z)
end
function tmp = code(x, y, z)
	tmp = (x * ((y - z) + 1.0)) / z;
end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 87.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
	return (x * ((y - z) + 1.0)) / z;
}
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 - z) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
	return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z):
	return (x * ((y - z) + 1.0)) / z
function code(x, y, z)
	return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z)
end
function tmp = code(x, y, z)
	tmp = (x * ((y - z) + 1.0)) / z;
end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \mathbf{if}\;z \leq -8 \cdot 10^{-20}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{-99}:\\ \;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (+ -1.0 (/ (+ y 1.0) z)))))
   (if (<= z -8e-20) t_0 (if (<= z 1.42e-99) (/ (* x (+ y 1.0)) z) t_0))))
double code(double x, double y, double z) {
	double t_0 = x * (-1.0 + ((y + 1.0) / z));
	double tmp;
	if (z <= -8e-20) {
		tmp = t_0;
	} else if (z <= 1.42e-99) {
		tmp = (x * (y + 1.0)) / z;
	} 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) :: tmp
    t_0 = x * ((-1.0d0) + ((y + 1.0d0) / z))
    if (z <= (-8d-20)) then
        tmp = t_0
    else if (z <= 1.42d-99) then
        tmp = (x * (y + 1.0d0)) / z
    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 + ((y + 1.0) / z));
	double tmp;
	if (z <= -8e-20) {
		tmp = t_0;
	} else if (z <= 1.42e-99) {
		tmp = (x * (y + 1.0)) / z;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * (-1.0 + ((y + 1.0) / z))
	tmp = 0
	if z <= -8e-20:
		tmp = t_0
	elif z <= 1.42e-99:
		tmp = (x * (y + 1.0)) / z
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(x * Float64(-1.0 + Float64(Float64(y + 1.0) / z)))
	tmp = 0.0
	if (z <= -8e-20)
		tmp = t_0;
	elseif (z <= 1.42e-99)
		tmp = Float64(Float64(x * Float64(y + 1.0)) / z);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * (-1.0 + ((y + 1.0) / z));
	tmp = 0.0;
	if (z <= -8e-20)
		tmp = t_0;
	elseif (z <= 1.42e-99)
		tmp = (x * (y + 1.0)) / z;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-1.0 + N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e-20], t$95$0, If[LessEqual[z, 1.42e-99], N[(N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(-1 + \frac{y + 1}{z}\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{-20}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 1.42 \cdot 10^{-99}:\\
\;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.99999999999999956e-20 or 1.42e-99 < z

    1. Initial program 74.5%

      \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
      3. associate-+l-N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
      4. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
      5. sub-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
      7. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
      8. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
      9. *-inversesN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
      10. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
      11. distribute-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
      13. associate-+l-N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
      14. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
      16. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
      17. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
      18. distribute-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
      19. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
      20. distribute-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
      21. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
      22. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
      23. metadata-eval99.9%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot \left(-1 - \frac{-1 - y}{z}\right)} \]
    4. Add Preprocessing

    if -7.99999999999999956e-20 < z < 1.42e-99

    1. Initial program 100.0%

      \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\color{blue}{y}, 1\right)\right), z\right) \]
    4. Step-by-step derivation
      1. Simplified100.0%

        \[\leadsto \frac{x \cdot \left(\color{blue}{y} + 1\right)}{z} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification99.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{-20}:\\ \;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{-99}:\\ \;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 2: 64.9% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -4.6 \cdot 10^{+21}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-70}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-301}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-124}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 5.2:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (* y (/ x z))))
       (if (<= z -4.6e+21)
         (- 0.0 x)
         (if (<= z -9.5e-70)
           t_0
           (if (<= z -5.5e-301)
             (/ x z)
             (if (<= z 4.6e-124) t_0 (if (<= z 5.2) (/ x z) (- 0.0 x))))))))
    double code(double x, double y, double z) {
    	double t_0 = y * (x / z);
    	double tmp;
    	if (z <= -4.6e+21) {
    		tmp = 0.0 - x;
    	} else if (z <= -9.5e-70) {
    		tmp = t_0;
    	} else if (z <= -5.5e-301) {
    		tmp = x / z;
    	} else if (z <= 4.6e-124) {
    		tmp = t_0;
    	} else if (z <= 5.2) {
    		tmp = x / z;
    	} else {
    		tmp = 0.0 - x;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: t_0
        real(8) :: tmp
        t_0 = y * (x / z)
        if (z <= (-4.6d+21)) then
            tmp = 0.0d0 - x
        else if (z <= (-9.5d-70)) then
            tmp = t_0
        else if (z <= (-5.5d-301)) then
            tmp = x / z
        else if (z <= 4.6d-124) then
            tmp = t_0
        else if (z <= 5.2d0) then
            tmp = x / z
        else
            tmp = 0.0d0 - x
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = y * (x / z);
    	double tmp;
    	if (z <= -4.6e+21) {
    		tmp = 0.0 - x;
    	} else if (z <= -9.5e-70) {
    		tmp = t_0;
    	} else if (z <= -5.5e-301) {
    		tmp = x / z;
    	} else if (z <= 4.6e-124) {
    		tmp = t_0;
    	} else if (z <= 5.2) {
    		tmp = x / z;
    	} else {
    		tmp = 0.0 - x;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = y * (x / z)
    	tmp = 0
    	if z <= -4.6e+21:
    		tmp = 0.0 - x
    	elif z <= -9.5e-70:
    		tmp = t_0
    	elif z <= -5.5e-301:
    		tmp = x / z
    	elif z <= 4.6e-124:
    		tmp = t_0
    	elif z <= 5.2:
    		tmp = x / z
    	else:
    		tmp = 0.0 - x
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(y * Float64(x / z))
    	tmp = 0.0
    	if (z <= -4.6e+21)
    		tmp = Float64(0.0 - x);
    	elseif (z <= -9.5e-70)
    		tmp = t_0;
    	elseif (z <= -5.5e-301)
    		tmp = Float64(x / z);
    	elseif (z <= 4.6e-124)
    		tmp = t_0;
    	elseif (z <= 5.2)
    		tmp = Float64(x / z);
    	else
    		tmp = Float64(0.0 - x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = y * (x / z);
    	tmp = 0.0;
    	if (z <= -4.6e+21)
    		tmp = 0.0 - x;
    	elseif (z <= -9.5e-70)
    		tmp = t_0;
    	elseif (z <= -5.5e-301)
    		tmp = x / z;
    	elseif (z <= 4.6e-124)
    		tmp = t_0;
    	elseif (z <= 5.2)
    		tmp = x / z;
    	else
    		tmp = 0.0 - x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+21], N[(0.0 - x), $MachinePrecision], If[LessEqual[z, -9.5e-70], t$95$0, If[LessEqual[z, -5.5e-301], N[(x / z), $MachinePrecision], If[LessEqual[z, 4.6e-124], t$95$0, If[LessEqual[z, 5.2], N[(x / z), $MachinePrecision], N[(0.0 - x), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := y \cdot \frac{x}{z}\\
    \mathbf{if}\;z \leq -4.6 \cdot 10^{+21}:\\
    \;\;\;\;0 - x\\
    
    \mathbf{elif}\;z \leq -9.5 \cdot 10^{-70}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq -5.5 \cdot 10^{-301}:\\
    \;\;\;\;\frac{x}{z}\\
    
    \mathbf{elif}\;z \leq 4.6 \cdot 10^{-124}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 5.2:\\
    \;\;\;\;\frac{x}{z}\\
    
    \mathbf{else}:\\
    \;\;\;\;0 - x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -4.6e21 or 5.20000000000000018 < z

      1. Initial program 68.5%

        \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
      2. Step-by-step derivation
        1. associate-/l*N/A

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

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
        3. associate-+l-N/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
        4. div-subN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
        5. sub-negN/A

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

          \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
        7. div-subN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
        8. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
        9. *-inversesN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
        10. distribute-neg-fracN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
        11. distribute-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
        13. associate-+l-N/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
        14. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
        16. div-subN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
        17. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
        18. distribute-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
        19. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
        20. distribute-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
        21. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
        22. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
        23. metadata-eval99.9%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
      3. Simplified99.9%

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

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

          \[\leadsto \mathsf{neg}\left(x\right) \]
        2. neg-sub0N/A

          \[\leadsto 0 - \color{blue}{x} \]
        3. --lowering--.f6476.7%

          \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
      7. Simplified76.7%

        \[\leadsto \color{blue}{0 - x} \]
      8. Step-by-step derivation
        1. sub0-negN/A

          \[\leadsto \mathsf{neg}\left(x\right) \]
        2. neg-lowering-neg.f6476.7%

          \[\leadsto \mathsf{neg.f64}\left(x\right) \]
      9. Applied egg-rr76.7%

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

      if -4.6e21 < z < -9.4999999999999994e-70 or -5.50000000000000005e-301 < z < 4.60000000000000024e-124

      1. Initial program 99.9%

        \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{\left(\left(y - z\right) + 1\right) \cdot x}{z} \]
        2. associate-/l*N/A

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

          \[\leadsto \mathsf{*.f64}\left(\left(\left(y - z\right) + 1\right), \color{blue}{\left(\frac{x}{z}\right)}\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(y - z\right), 1\right), \left(\frac{\color{blue}{x}}{z}\right)\right) \]
        5. --lowering--.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(y, z\right), 1\right), \left(\frac{x}{z}\right)\right) \]
        6. /-lowering-/.f6499.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(y, z\right), 1\right), \mathsf{/.f64}\left(x, \color{blue}{z}\right)\right) \]
      4. Applied egg-rr99.8%

        \[\leadsto \color{blue}{\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}} \]
      5. Taylor expanded in y around inf

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{y}, \mathsf{/.f64}\left(x, z\right)\right) \]
      6. Step-by-step derivation
        1. Simplified68.4%

          \[\leadsto \color{blue}{y} \cdot \frac{x}{z} \]

        if -9.4999999999999994e-70 < z < -5.50000000000000005e-301 or 4.60000000000000024e-124 < z < 5.20000000000000018

        1. Initial program 100.0%

          \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
        2. Step-by-step derivation
          1. associate-/l*N/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
          3. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
          4. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
          5. sub-negN/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
          7. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          8. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          9. *-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          10. distribute-neg-fracN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          11. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          13. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          14. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
          17. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
          18. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
          19. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
          20. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
          21. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
          22. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
          23. metadata-eval97.4%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
        3. Simplified97.4%

          \[\leadsto \color{blue}{x \cdot \left(-1 - \frac{-1 - y}{z}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in y around 0

          \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(1 - \frac{1}{z}\right)\right)} \]
        6. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(x \cdot \left(1 - \frac{1}{z}\right)\right) \]
          2. distribute-lft-out--N/A

            \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - x \cdot \frac{1}{z}\right)\right) \]
          3. associate-*r/N/A

            \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x \cdot 1}{z}\right)\right) \]
          4. *-rgt-identityN/A

            \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x}{z}\right)\right) \]
          5. *-rgt-identityN/A

            \[\leadsto \mathsf{neg}\left(\left(x - \frac{x}{z}\right)\right) \]
          6. unsub-negN/A

            \[\leadsto \mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) \]
          7. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(\left(x + -1 \cdot \frac{x}{z}\right)\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{x}{z} + x\right)\right) \]
          9. distribute-neg-inN/A

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

            \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right) \]
          11. remove-double-negN/A

            \[\leadsto \frac{x}{z} + \left(\mathsf{neg}\left(\color{blue}{x}\right)\right) \]
          12. sub-negN/A

            \[\leadsto \frac{x}{z} - \color{blue}{x} \]
          13. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(\frac{x}{z}\right), \color{blue}{x}\right) \]
          14. /-lowering-/.f6468.7%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, z\right), x\right) \]
        7. Simplified68.7%

          \[\leadsto \color{blue}{\frac{x}{z} - x} \]
        8. Taylor expanded in z around 0

          \[\leadsto \color{blue}{\frac{x}{z}} \]
        9. Step-by-step derivation
          1. /-lowering-/.f6468.4%

            \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{z}\right) \]
        10. Simplified68.4%

          \[\leadsto \color{blue}{\frac{x}{z}} \]
      7. Recombined 3 regimes into one program.
      8. Final simplification72.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+21}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-70}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-301}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-124}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 5.2:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
      9. Add Preprocessing

      Alternative 3: 64.6% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+22}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-70}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 5.2:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= z -3.6e+22)
         (- 0.0 x)
         (if (<= z -1.95e-70) (* x (/ y z)) (if (<= z 5.2) (/ x z) (- 0.0 x)))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (z <= -3.6e+22) {
      		tmp = 0.0 - x;
      	} else if (z <= -1.95e-70) {
      		tmp = x * (y / z);
      	} else if (z <= 5.2) {
      		tmp = x / z;
      	} else {
      		tmp = 0.0 - x;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: tmp
          if (z <= (-3.6d+22)) then
              tmp = 0.0d0 - x
          else if (z <= (-1.95d-70)) then
              tmp = x * (y / z)
          else if (z <= 5.2d0) then
              tmp = x / z
          else
              tmp = 0.0d0 - x
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if (z <= -3.6e+22) {
      		tmp = 0.0 - x;
      	} else if (z <= -1.95e-70) {
      		tmp = x * (y / z);
      	} else if (z <= 5.2) {
      		tmp = x / z;
      	} else {
      		tmp = 0.0 - x;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if z <= -3.6e+22:
      		tmp = 0.0 - x
      	elif z <= -1.95e-70:
      		tmp = x * (y / z)
      	elif z <= 5.2:
      		tmp = x / z
      	else:
      		tmp = 0.0 - x
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (z <= -3.6e+22)
      		tmp = Float64(0.0 - x);
      	elseif (z <= -1.95e-70)
      		tmp = Float64(x * Float64(y / z));
      	elseif (z <= 5.2)
      		tmp = Float64(x / z);
      	else
      		tmp = Float64(0.0 - x);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (z <= -3.6e+22)
      		tmp = 0.0 - x;
      	elseif (z <= -1.95e-70)
      		tmp = x * (y / z);
      	elseif (z <= 5.2)
      		tmp = x / z;
      	else
      		tmp = 0.0 - x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[z, -3.6e+22], N[(0.0 - x), $MachinePrecision], If[LessEqual[z, -1.95e-70], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2], N[(x / z), $MachinePrecision], N[(0.0 - x), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -3.6 \cdot 10^{+22}:\\
      \;\;\;\;0 - x\\
      
      \mathbf{elif}\;z \leq -1.95 \cdot 10^{-70}:\\
      \;\;\;\;x \cdot \frac{y}{z}\\
      
      \mathbf{elif}\;z \leq 5.2:\\
      \;\;\;\;\frac{x}{z}\\
      
      \mathbf{else}:\\
      \;\;\;\;0 - x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -3.6e22 or 5.20000000000000018 < z

        1. Initial program 68.5%

          \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
        2. Step-by-step derivation
          1. associate-/l*N/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
          3. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
          4. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
          5. sub-negN/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
          7. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          8. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          9. *-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          10. distribute-neg-fracN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          11. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          13. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          14. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
          17. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
          18. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
          19. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
          20. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
          21. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
          22. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
          23. metadata-eval99.9%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
        3. Simplified99.9%

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

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

            \[\leadsto \mathsf{neg}\left(x\right) \]
          2. neg-sub0N/A

            \[\leadsto 0 - \color{blue}{x} \]
          3. --lowering--.f6476.7%

            \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
        7. Simplified76.7%

          \[\leadsto \color{blue}{0 - x} \]
        8. Step-by-step derivation
          1. sub0-negN/A

            \[\leadsto \mathsf{neg}\left(x\right) \]
          2. neg-lowering-neg.f6476.7%

            \[\leadsto \mathsf{neg.f64}\left(x\right) \]
        9. Applied egg-rr76.7%

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

        if -3.6e22 < z < -1.9500000000000001e-70

        1. Initial program 99.8%

          \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
        2. Step-by-step derivation
          1. associate-/l*N/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
          3. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
          4. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
          5. sub-negN/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
          7. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          8. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          9. *-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          10. distribute-neg-fracN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          11. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          13. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          14. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
          17. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
          18. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
          19. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
          20. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
          21. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
          22. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
          23. metadata-eval94.5%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
        3. Simplified94.5%

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

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{y}{z}\right)}\right) \]
        6. Step-by-step derivation
          1. /-lowering-/.f6457.1%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(y, \color{blue}{z}\right)\right) \]
        7. Simplified57.1%

          \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]

        if -1.9500000000000001e-70 < z < 5.20000000000000018

        1. Initial program 100.0%

          \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
        2. Step-by-step derivation
          1. associate-/l*N/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
          3. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
          4. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
          5. sub-negN/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
          7. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          8. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          9. *-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          10. distribute-neg-fracN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          11. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          13. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          14. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
          17. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
          18. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
          19. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
          20. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
          21. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
          22. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
          23. metadata-eval92.2%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
        3. Simplified92.2%

          \[\leadsto \color{blue}{x \cdot \left(-1 - \frac{-1 - y}{z}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in y around 0

          \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(1 - \frac{1}{z}\right)\right)} \]
        6. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(x \cdot \left(1 - \frac{1}{z}\right)\right) \]
          2. distribute-lft-out--N/A

            \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - x \cdot \frac{1}{z}\right)\right) \]
          3. associate-*r/N/A

            \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x \cdot 1}{z}\right)\right) \]
          4. *-rgt-identityN/A

            \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x}{z}\right)\right) \]
          5. *-rgt-identityN/A

            \[\leadsto \mathsf{neg}\left(\left(x - \frac{x}{z}\right)\right) \]
          6. unsub-negN/A

            \[\leadsto \mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) \]
          7. mul-1-negN/A

            \[\leadsto \mathsf{neg}\left(\left(x + -1 \cdot \frac{x}{z}\right)\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{x}{z} + x\right)\right) \]
          9. distribute-neg-inN/A

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

            \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right) \]
          11. remove-double-negN/A

            \[\leadsto \frac{x}{z} + \left(\mathsf{neg}\left(\color{blue}{x}\right)\right) \]
          12. sub-negN/A

            \[\leadsto \frac{x}{z} - \color{blue}{x} \]
          13. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(\frac{x}{z}\right), \color{blue}{x}\right) \]
          14. /-lowering-/.f6461.2%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, z\right), x\right) \]
        7. Simplified61.2%

          \[\leadsto \color{blue}{\frac{x}{z} - x} \]
        8. Taylor expanded in z around 0

          \[\leadsto \color{blue}{\frac{x}{z}} \]
        9. Step-by-step derivation
          1. /-lowering-/.f6461.1%

            \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{z}\right) \]
        10. Simplified61.1%

          \[\leadsto \color{blue}{\frac{x}{z}} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification67.7%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+22}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-70}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 5.2:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
      5. Add Preprocessing

      Alternative 4: 86.6% accurate, 0.5× speedup?

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

        1. Initial program 63.8%

          \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
        2. Step-by-step derivation
          1. associate-/l*N/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
          3. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
          4. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
          5. sub-negN/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
          7. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          8. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          9. *-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
          10. distribute-neg-fracN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
          11. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
          13. associate-+l-N/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          14. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
          15. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
          17. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
          18. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
          19. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
          20. distribute-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
          21. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
          22. --lowering--.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
          23. metadata-eval99.9%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
        3. Simplified99.9%

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

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

            \[\leadsto \mathsf{neg}\left(x\right) \]
          2. neg-sub0N/A

            \[\leadsto 0 - \color{blue}{x} \]
          3. --lowering--.f6480.1%

            \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
        7. Simplified80.1%

          \[\leadsto \color{blue}{0 - x} \]
        8. Step-by-step derivation
          1. sub0-negN/A

            \[\leadsto \mathsf{neg}\left(x\right) \]
          2. neg-lowering-neg.f6480.1%

            \[\leadsto \mathsf{neg.f64}\left(x\right) \]
        9. Applied egg-rr80.1%

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

        if -6.5e20 < z < 3400

        1. Initial program 99.9%

          \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\color{blue}{y}, 1\right)\right), z\right) \]
        4. Step-by-step derivation
          1. Simplified98.9%

            \[\leadsto \frac{x \cdot \left(\color{blue}{y} + 1\right)}{z} \]

          if 3400 < z

          1. Initial program 74.1%

            \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
          2. Step-by-step derivation
            1. associate-/l*N/A

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

              \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
            3. associate-+l-N/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
            4. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
            5. sub-negN/A

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

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
            7. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
            8. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
            9. *-inversesN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
            10. distribute-neg-fracN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
            11. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
            12. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
            13. associate-+l-N/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
            14. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
            15. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
            17. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
            18. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
            19. /-lowering-/.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
            20. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
            21. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
            22. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
            23. metadata-eval99.9%

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
          3. Simplified99.9%

            \[\leadsto \color{blue}{x \cdot \left(-1 - \frac{-1 - y}{z}\right)} \]
          4. Add Preprocessing
          5. Taylor expanded in y around 0

            \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(1 - \frac{1}{z}\right)\right)} \]
          6. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(x \cdot \left(1 - \frac{1}{z}\right)\right) \]
            2. distribute-lft-out--N/A

              \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - x \cdot \frac{1}{z}\right)\right) \]
            3. associate-*r/N/A

              \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x \cdot 1}{z}\right)\right) \]
            4. *-rgt-identityN/A

              \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x}{z}\right)\right) \]
            5. *-rgt-identityN/A

              \[\leadsto \mathsf{neg}\left(\left(x - \frac{x}{z}\right)\right) \]
            6. unsub-negN/A

              \[\leadsto \mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) \]
            7. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(\left(x + -1 \cdot \frac{x}{z}\right)\right) \]
            8. +-commutativeN/A

              \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{x}{z} + x\right)\right) \]
            9. distribute-neg-inN/A

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

              \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right) \]
            11. remove-double-negN/A

              \[\leadsto \frac{x}{z} + \left(\mathsf{neg}\left(\color{blue}{x}\right)\right) \]
            12. sub-negN/A

              \[\leadsto \frac{x}{z} - \color{blue}{x} \]
            13. --lowering--.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\left(\frac{x}{z}\right), \color{blue}{x}\right) \]
            14. /-lowering-/.f6473.5%

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, z\right), x\right) \]
          7. Simplified73.5%

            \[\leadsto \color{blue}{\frac{x}{z} - x} \]
        5. Recombined 3 regimes into one program.
        6. Final simplification89.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+20}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq 3400:\\ \;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} - x\\ \end{array} \]
        7. Add Preprocessing

        Alternative 5: 85.1% accurate, 0.6× speedup?

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

          1. Initial program 87.7%

            \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
          2. Step-by-step derivation
            1. associate-/l*N/A

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

              \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
            3. associate-+l-N/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
            4. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
            5. sub-negN/A

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

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
            7. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
            8. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
            9. *-inversesN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
            10. distribute-neg-fracN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
            11. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
            12. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
            13. associate-+l-N/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
            14. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
            15. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
            17. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
            18. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
            19. /-lowering-/.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
            20. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
            21. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
            22. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
            23. metadata-eval92.3%

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
          3. Simplified92.3%

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

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

              \[\leadsto \mathsf{/.f64}\left(\left(x \cdot y\right), \color{blue}{z}\right) \]
            2. *-lowering-*.f6474.7%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), z\right) \]
          7. Simplified74.7%

            \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]

          if -116 < y < 8.4e17

          1. Initial program 84.7%

            \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
          2. Step-by-step derivation
            1. associate-/l*N/A

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

              \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
            3. associate-+l-N/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
            4. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
            5. sub-negN/A

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

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
            7. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
            8. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
            9. *-inversesN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
            10. distribute-neg-fracN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
            11. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
            12. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
            13. associate-+l-N/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
            14. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
            15. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
            17. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
            18. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
            19. /-lowering-/.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
            20. distribute-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
            21. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
            22. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
            23. metadata-eval99.8%

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
          3. Simplified99.8%

            \[\leadsto \color{blue}{x \cdot \left(-1 - \frac{-1 - y}{z}\right)} \]
          4. Add Preprocessing
          5. Taylor expanded in y around 0

            \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(1 - \frac{1}{z}\right)\right)} \]
          6. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(x \cdot \left(1 - \frac{1}{z}\right)\right) \]
            2. distribute-lft-out--N/A

              \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - x \cdot \frac{1}{z}\right)\right) \]
            3. associate-*r/N/A

              \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x \cdot 1}{z}\right)\right) \]
            4. *-rgt-identityN/A

              \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x}{z}\right)\right) \]
            5. *-rgt-identityN/A

              \[\leadsto \mathsf{neg}\left(\left(x - \frac{x}{z}\right)\right) \]
            6. unsub-negN/A

              \[\leadsto \mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) \]
            7. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(\left(x + -1 \cdot \frac{x}{z}\right)\right) \]
            8. +-commutativeN/A

              \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{x}{z} + x\right)\right) \]
            9. distribute-neg-inN/A

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

              \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right) \]
            11. remove-double-negN/A

              \[\leadsto \frac{x}{z} + \left(\mathsf{neg}\left(\color{blue}{x}\right)\right) \]
            12. sub-negN/A

              \[\leadsto \frac{x}{z} - \color{blue}{x} \]
            13. --lowering--.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\left(\frac{x}{z}\right), \color{blue}{x}\right) \]
            14. /-lowering-/.f6496.7%

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, z\right), x\right) \]
          7. Simplified96.7%

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

          if 8.4e17 < y

          1. Initial program 87.6%

            \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \frac{\left(\left(y - z\right) + 1\right) \cdot x}{z} \]
            2. associate-/l*N/A

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

              \[\leadsto \mathsf{*.f64}\left(\left(\left(y - z\right) + 1\right), \color{blue}{\left(\frac{x}{z}\right)}\right) \]
            4. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(y - z\right), 1\right), \left(\frac{\color{blue}{x}}{z}\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(y, z\right), 1\right), \left(\frac{x}{z}\right)\right) \]
            6. /-lowering-/.f6492.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(y, z\right), 1\right), \mathsf{/.f64}\left(x, \color{blue}{z}\right)\right) \]
          4. Applied egg-rr92.9%

            \[\leadsto \color{blue}{\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}} \]
          5. Taylor expanded in y around inf

            \[\leadsto \mathsf{*.f64}\left(\color{blue}{y}, \mathsf{/.f64}\left(x, z\right)\right) \]
          6. Step-by-step derivation
            1. Simplified77.5%

              \[\leadsto \color{blue}{y} \cdot \frac{x}{z} \]
          7. Recombined 3 regimes into one program.
          8. Add Preprocessing

          Alternative 6: 85.4% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \frac{x}{z}\\ \mathbf{if}\;y \leq -6600:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+28}:\\ \;\;\;\;\frac{x}{z} - x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (* y (/ x z))))
             (if (<= y -6600.0) t_0 (if (<= y 1.15e+28) (- (/ x z) x) t_0))))
          double code(double x, double y, double z) {
          	double t_0 = y * (x / z);
          	double tmp;
          	if (y <= -6600.0) {
          		tmp = t_0;
          	} else if (y <= 1.15e+28) {
          		tmp = (x / z) - x;
          	} 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) :: tmp
              t_0 = y * (x / z)
              if (y <= (-6600.0d0)) then
                  tmp = t_0
              else if (y <= 1.15d+28) then
                  tmp = (x / z) - x
              else
                  tmp = t_0
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double t_0 = y * (x / z);
          	double tmp;
          	if (y <= -6600.0) {
          		tmp = t_0;
          	} else if (y <= 1.15e+28) {
          		tmp = (x / z) - x;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	t_0 = y * (x / z)
          	tmp = 0
          	if y <= -6600.0:
          		tmp = t_0
          	elif y <= 1.15e+28:
          		tmp = (x / z) - x
          	else:
          		tmp = t_0
          	return tmp
          
          function code(x, y, z)
          	t_0 = Float64(y * Float64(x / z))
          	tmp = 0.0
          	if (y <= -6600.0)
          		tmp = t_0;
          	elseif (y <= 1.15e+28)
          		tmp = Float64(Float64(x / z) - x);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	t_0 = y * (x / z);
          	tmp = 0.0;
          	if (y <= -6600.0)
          		tmp = t_0;
          	elseif (y <= 1.15e+28)
          		tmp = (x / z) - x;
          	else
          		tmp = t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6600.0], t$95$0, If[LessEqual[y, 1.15e+28], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := y \cdot \frac{x}{z}\\
          \mathbf{if}\;y \leq -6600:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;y \leq 1.15 \cdot 10^{+28}:\\
          \;\;\;\;\frac{x}{z} - x\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -6600 or 1.14999999999999992e28 < y

            1. Initial program 87.6%

              \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{\left(\left(y - z\right) + 1\right) \cdot x}{z} \]
              2. associate-/l*N/A

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

                \[\leadsto \mathsf{*.f64}\left(\left(\left(y - z\right) + 1\right), \color{blue}{\left(\frac{x}{z}\right)}\right) \]
              4. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(y - z\right), 1\right), \left(\frac{\color{blue}{x}}{z}\right)\right) \]
              5. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(y, z\right), 1\right), \left(\frac{x}{z}\right)\right) \]
              6. /-lowering-/.f6490.8%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(y, z\right), 1\right), \mathsf{/.f64}\left(x, \color{blue}{z}\right)\right) \]
            4. Applied egg-rr90.8%

              \[\leadsto \color{blue}{\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}} \]
            5. Taylor expanded in y around inf

              \[\leadsto \mathsf{*.f64}\left(\color{blue}{y}, \mathsf{/.f64}\left(x, z\right)\right) \]
            6. Step-by-step derivation
              1. Simplified75.0%

                \[\leadsto \color{blue}{y} \cdot \frac{x}{z} \]

              if -6600 < y < 1.14999999999999992e28

              1. Initial program 84.7%

                \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
              2. Step-by-step derivation
                1. associate-/l*N/A

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

                  \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
                3. associate-+l-N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
                4. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
                5. sub-negN/A

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

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
                7. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
                8. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
                9. *-inversesN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
                10. distribute-neg-fracN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
                11. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
                12. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
                13. associate-+l-N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
                14. --lowering--.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
                15. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
                16. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
                17. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
                18. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
                19. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
                20. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
                21. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
                22. --lowering--.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
                23. metadata-eval99.8%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
              3. Simplified99.8%

                \[\leadsto \color{blue}{x \cdot \left(-1 - \frac{-1 - y}{z}\right)} \]
              4. Add Preprocessing
              5. Taylor expanded in y around 0

                \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(1 - \frac{1}{z}\right)\right)} \]
              6. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \mathsf{neg}\left(x \cdot \left(1 - \frac{1}{z}\right)\right) \]
                2. distribute-lft-out--N/A

                  \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - x \cdot \frac{1}{z}\right)\right) \]
                3. associate-*r/N/A

                  \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x \cdot 1}{z}\right)\right) \]
                4. *-rgt-identityN/A

                  \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x}{z}\right)\right) \]
                5. *-rgt-identityN/A

                  \[\leadsto \mathsf{neg}\left(\left(x - \frac{x}{z}\right)\right) \]
                6. unsub-negN/A

                  \[\leadsto \mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) \]
                7. mul-1-negN/A

                  \[\leadsto \mathsf{neg}\left(\left(x + -1 \cdot \frac{x}{z}\right)\right) \]
                8. +-commutativeN/A

                  \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{x}{z} + x\right)\right) \]
                9. distribute-neg-inN/A

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

                  \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right) \]
                11. remove-double-negN/A

                  \[\leadsto \frac{x}{z} + \left(\mathsf{neg}\left(\color{blue}{x}\right)\right) \]
                12. sub-negN/A

                  \[\leadsto \frac{x}{z} - \color{blue}{x} \]
                13. --lowering--.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\frac{x}{z}\right), \color{blue}{x}\right) \]
                14. /-lowering-/.f6496.7%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, z\right), x\right) \]
              7. Simplified96.7%

                \[\leadsto \color{blue}{\frac{x}{z} - x} \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 7: 93.9% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y - z\right) + 1\\ \mathbf{if}\;x \leq 2 \cdot 10^{+14}:\\ \;\;\;\;\frac{x \cdot t\_0}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{t\_0}}\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (+ (- y z) 1.0)))
               (if (<= x 2e+14) (/ (* x t_0) z) (/ x (/ z t_0)))))
            double code(double x, double y, double z) {
            	double t_0 = (y - z) + 1.0;
            	double tmp;
            	if (x <= 2e+14) {
            		tmp = (x * t_0) / z;
            	} else {
            		tmp = x / (z / 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) :: tmp
                t_0 = (y - z) + 1.0d0
                if (x <= 2d+14) then
                    tmp = (x * t_0) / z
                else
                    tmp = x / (z / t_0)
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = (y - z) + 1.0;
            	double tmp;
            	if (x <= 2e+14) {
            		tmp = (x * t_0) / z;
            	} else {
            		tmp = x / (z / t_0);
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = (y - z) + 1.0
            	tmp = 0
            	if x <= 2e+14:
            		tmp = (x * t_0) / z
            	else:
            		tmp = x / (z / t_0)
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(Float64(y - z) + 1.0)
            	tmp = 0.0
            	if (x <= 2e+14)
            		tmp = Float64(Float64(x * t_0) / z);
            	else
            		tmp = Float64(x / Float64(z / t_0));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = (y - z) + 1.0;
            	tmp = 0.0;
            	if (x <= 2e+14)
            		tmp = (x * t_0) / z;
            	else
            		tmp = x / (z / t_0);
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x, 2e+14], N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(z / t$95$0), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(y - z\right) + 1\\
            \mathbf{if}\;x \leq 2 \cdot 10^{+14}:\\
            \;\;\;\;\frac{x \cdot t\_0}{z}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{x}{\frac{z}{t\_0}}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < 2e14

              1. Initial program 91.1%

                \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
              2. Add Preprocessing

              if 2e14 < x

              1. Initial program 71.2%

                \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. associate-/l*N/A

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

                  \[\leadsto x \cdot \frac{1}{\color{blue}{\frac{z}{\left(y - z\right) + 1}}} \]
                3. un-div-invN/A

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

                  \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{z}{\left(y - z\right) + 1}\right)}\right) \]
                5. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(z, \color{blue}{\left(\left(y - z\right) + 1\right)}\right)\right) \]
                6. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(\left(y - z\right), \color{blue}{1}\right)\right)\right) \]
                7. --lowering--.f6499.9%

                  \[\leadsto \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(y, z\right), 1\right)\right)\right) \]
              4. Applied egg-rr99.9%

                \[\leadsto \color{blue}{\frac{x}{\frac{z}{\left(y - z\right) + 1}}} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 8: 64.4% accurate, 0.7× speedup?

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

              1. Initial program 68.7%

                \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
              2. Step-by-step derivation
                1. associate-/l*N/A

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

                  \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
                3. associate-+l-N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
                4. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
                5. sub-negN/A

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

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
                7. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
                8. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
                9. *-inversesN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
                10. distribute-neg-fracN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
                11. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
                12. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
                13. associate-+l-N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
                14. --lowering--.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
                15. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
                16. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
                17. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
                18. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
                19. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
                20. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
                21. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
                22. --lowering--.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
                23. metadata-eval99.9%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
              3. Simplified99.9%

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

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

                  \[\leadsto \mathsf{neg}\left(x\right) \]
                2. neg-sub0N/A

                  \[\leadsto 0 - \color{blue}{x} \]
                3. --lowering--.f6476.1%

                  \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
              7. Simplified76.1%

                \[\leadsto \color{blue}{0 - x} \]
              8. Step-by-step derivation
                1. sub0-negN/A

                  \[\leadsto \mathsf{neg}\left(x\right) \]
                2. neg-lowering-neg.f6476.1%

                  \[\leadsto \mathsf{neg.f64}\left(x\right) \]
              9. Applied egg-rr76.1%

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

              if -1.6e20 < z < 5.20000000000000018

              1. Initial program 99.9%

                \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
              2. Step-by-step derivation
                1. associate-/l*N/A

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

                  \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
                3. associate-+l-N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
                4. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
                5. sub-negN/A

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

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
                7. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
                8. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
                9. *-inversesN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
                10. distribute-neg-fracN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
                11. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
                12. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
                13. associate-+l-N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
                14. --lowering--.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
                15. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
                16. div-subN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
                17. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
                18. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
                19. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
                20. distribute-neg-inN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
                21. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
                22. --lowering--.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
                23. metadata-eval92.5%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
              3. Simplified92.5%

                \[\leadsto \color{blue}{x \cdot \left(-1 - \frac{-1 - y}{z}\right)} \]
              4. Add Preprocessing
              5. Taylor expanded in y around 0

                \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(1 - \frac{1}{z}\right)\right)} \]
              6. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \mathsf{neg}\left(x \cdot \left(1 - \frac{1}{z}\right)\right) \]
                2. distribute-lft-out--N/A

                  \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - x \cdot \frac{1}{z}\right)\right) \]
                3. associate-*r/N/A

                  \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x \cdot 1}{z}\right)\right) \]
                4. *-rgt-identityN/A

                  \[\leadsto \mathsf{neg}\left(\left(x \cdot 1 - \frac{x}{z}\right)\right) \]
                5. *-rgt-identityN/A

                  \[\leadsto \mathsf{neg}\left(\left(x - \frac{x}{z}\right)\right) \]
                6. unsub-negN/A

                  \[\leadsto \mathsf{neg}\left(\left(x + \left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) \]
                7. mul-1-negN/A

                  \[\leadsto \mathsf{neg}\left(\left(x + -1 \cdot \frac{x}{z}\right)\right) \]
                8. +-commutativeN/A

                  \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{x}{z} + x\right)\right) \]
                9. distribute-neg-inN/A

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

                  \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right) + \left(\mathsf{neg}\left(x\right)\right) \]
                11. remove-double-negN/A

                  \[\leadsto \frac{x}{z} + \left(\mathsf{neg}\left(\color{blue}{x}\right)\right) \]
                12. sub-negN/A

                  \[\leadsto \frac{x}{z} - \color{blue}{x} \]
                13. --lowering--.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\frac{x}{z}\right), \color{blue}{x}\right) \]
                14. /-lowering-/.f6458.2%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, z\right), x\right) \]
              7. Simplified58.2%

                \[\leadsto \color{blue}{\frac{x}{z} - x} \]
              8. Taylor expanded in z around 0

                \[\leadsto \color{blue}{\frac{x}{z}} \]
              9. Step-by-step derivation
                1. /-lowering-/.f6457.2%

                  \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{z}\right) \]
              10. Simplified57.2%

                \[\leadsto \color{blue}{\frac{x}{z}} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification65.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+20}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq 5.2:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
            5. Add Preprocessing

            Alternative 9: 38.9% accurate, 3.0× speedup?

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

              \[\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z} \]
            2. Step-by-step derivation
              1. associate-/l*N/A

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

                \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{\left(y - z\right) + 1}{z}\right)}\right) \]
              3. associate-+l-N/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y - \left(z - 1\right)}{z}\right)\right) \]
              4. div-subN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y}{z} - \color{blue}{\frac{z - 1}{z}}\right)\right) \]
              5. sub-negN/A

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

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{z - 1}{z}\right)\right) + \color{blue}{\frac{y}{z}}\right)\right) \]
              7. div-subN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} - \frac{1}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
              8. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\frac{z}{z} + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
              9. *-inversesN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\frac{1}{z}\right)\right)\right)\right)\right) + \frac{y}{z}\right)\right) \]
              10. distribute-neg-fracN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(1 + \frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{y}{z}\right)\right) \]
              11. distribute-neg-inN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(1\right)}{z}\right)\right)\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
              12. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\mathsf{neg}\left(1\right)\right) - \frac{\mathsf{neg}\left(1\right)}{z}\right) + \frac{\color{blue}{y}}{z}\right)\right) \]
              13. associate-+l-N/A

                \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) - \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
              14. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), \color{blue}{\left(\frac{\mathsf{neg}\left(1\right)}{z} - \frac{y}{z}\right)}\right)\right) \]
              15. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\color{blue}{\frac{\mathsf{neg}\left(1\right)}{z}} - \frac{y}{z}\right)\right)\right) \]
              16. div-subN/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) - y}{\color{blue}{z}}\right)\right)\right) \]
              17. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z}\right)\right)\right) \]
              18. distribute-neg-inN/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \left(\frac{\mathsf{neg}\left(\left(1 + y\right)\right)}{z}\right)\right)\right) \]
              19. /-lowering-/.f64N/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(1 + y\right)\right)\right), \color{blue}{z}\right)\right)\right) \]
              20. distribute-neg-inN/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right), z\right)\right)\right) \]
              21. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(1\right)\right) - y\right), z\right)\right)\right) \]
              22. --lowering--.f64N/A

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
              23. metadata-eval95.8%

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
            3. Simplified95.8%

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

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

                \[\leadsto \mathsf{neg}\left(x\right) \]
              2. neg-sub0N/A

                \[\leadsto 0 - \color{blue}{x} \]
              3. --lowering--.f6435.8%

                \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
            7. Simplified35.8%

              \[\leadsto \color{blue}{0 - x} \]
            8. Step-by-step derivation
              1. sub0-negN/A

                \[\leadsto \mathsf{neg}\left(x\right) \]
              2. neg-lowering-neg.f6435.8%

                \[\leadsto \mathsf{neg.f64}\left(x\right) \]
            9. Applied egg-rr35.8%

              \[\leadsto \color{blue}{-x} \]
            10. Final simplification35.8%

              \[\leadsto 0 - x \]
            11. Add Preprocessing

            Developer Target 1: 99.5% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 + y\right) \cdot \frac{x}{z} - x\\ \mathbf{if}\;x < -2.71483106713436 \cdot 10^{-162}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x < 3.874108816439546 \cdot 10^{-197}:\\ \;\;\;\;\left(x \cdot \left(\left(y - z\right) + 1\right)\right) \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (- (* (+ 1.0 y) (/ x z)) x)))
               (if (< x -2.71483106713436e-162)
                 t_0
                 (if (< x 3.874108816439546e-197)
                   (* (* x (+ (- y z) 1.0)) (/ 1.0 z))
                   t_0))))
            double code(double x, double y, double z) {
            	double t_0 = ((1.0 + y) * (x / z)) - x;
            	double tmp;
            	if (x < -2.71483106713436e-162) {
            		tmp = t_0;
            	} else if (x < 3.874108816439546e-197) {
            		tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
            	} 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) :: tmp
                t_0 = ((1.0d0 + y) * (x / z)) - x
                if (x < (-2.71483106713436d-162)) then
                    tmp = t_0
                else if (x < 3.874108816439546d-197) then
                    tmp = (x * ((y - z) + 1.0d0)) * (1.0d0 / z)
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = ((1.0 + y) * (x / z)) - x;
            	double tmp;
            	if (x < -2.71483106713436e-162) {
            		tmp = t_0;
            	} else if (x < 3.874108816439546e-197) {
            		tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = ((1.0 + y) * (x / z)) - x
            	tmp = 0
            	if x < -2.71483106713436e-162:
            		tmp = t_0
            	elif x < 3.874108816439546e-197:
            		tmp = (x * ((y - z) + 1.0)) * (1.0 / z)
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(Float64(Float64(1.0 + y) * Float64(x / z)) - x)
            	tmp = 0.0
            	if (x < -2.71483106713436e-162)
            		tmp = t_0;
            	elseif (x < 3.874108816439546e-197)
            		tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) * Float64(1.0 / z));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = ((1.0 + y) * (x / z)) - x;
            	tmp = 0.0;
            	if (x < -2.71483106713436e-162)
            		tmp = t_0;
            	elseif (x < 3.874108816439546e-197)
            		tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]}, If[Less[x, -2.71483106713436e-162], t$95$0, If[Less[x, 3.874108816439546e-197], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(1 + y\right) \cdot \frac{x}{z} - x\\
            \mathbf{if}\;x < -2.71483106713436 \cdot 10^{-162}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;x < 3.874108816439546 \cdot 10^{-197}:\\
            \;\;\;\;\left(x \cdot \left(\left(y - z\right) + 1\right)\right) \cdot \frac{1}{z}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            

            Reproduce

            ?
            herbie shell --seed 2024161 
            (FPCore (x y z)
              :name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
              :precision binary64
            
              :alt
              (! :herbie-platform default (if (< x -67870776678359/25000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (+ 1 y) (/ x z)) x) (if (< x 1937054408219773/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (* x (+ (- y z) 1)) (/ 1 z)) (- (* (+ 1 y) (/ x z)) x))))
            
              (/ (* x (+ (- y z) 1.0)) z))