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

Percentage Accurate: 88.4% → 99.9%
Time: 7.3s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 88.4% 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.9% 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 -800000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{-6}:\\ \;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{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 -800000000.0)
     t_0
     (if (<= z 1.28e-6) (* (+ (- y z) 1.0) (/ x 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 <= -800000000.0) {
		tmp = t_0;
	} else if (z <= 1.28e-6) {
		tmp = ((y - z) + 1.0) * (x / 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 <= (-800000000.0d0)) then
        tmp = t_0
    else if (z <= 1.28d-6) then
        tmp = ((y - z) + 1.0d0) * (x / 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 <= -800000000.0) {
		tmp = t_0;
	} else if (z <= 1.28e-6) {
		tmp = ((y - z) + 1.0) * (x / 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 <= -800000000.0:
		tmp = t_0
	elif z <= 1.28e-6:
		tmp = ((y - z) + 1.0) * (x / 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 <= -800000000.0)
		tmp = t_0;
	elseif (z <= 1.28e-6)
		tmp = Float64(Float64(Float64(y - z) + 1.0) * Float64(x / 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 <= -800000000.0)
		tmp = t_0;
	elseif (z <= 1.28e-6)
		tmp = ((y - z) + 1.0) * (x / 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, -800000000.0], t$95$0, If[LessEqual[z, 1.28e-6], N[(N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $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 -800000000:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8e8 or 1.28e-6 < z

    1. Initial program 76.6%

      \[\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-eval100.0%

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

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

    if -8e8 < z < 1.28e-6

    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.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-rr99.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -800000000:\\ \;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{-6}:\\ \;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 65.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+64}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-10}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+53}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -4.9e+64)
   (- 0.0 x)
   (if (<= z -1.4e-36)
     (* x (/ y z))
     (if (<= z 3.8e-10) (/ x z) (if (<= z 3.2e+53) (* y (/ x z)) (- 0.0 x))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -4.9e+64) {
		tmp = 0.0 - x;
	} else if (z <= -1.4e-36) {
		tmp = x * (y / z);
	} else if (z <= 3.8e-10) {
		tmp = x / z;
	} else if (z <= 3.2e+53) {
		tmp = y * (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 <= (-4.9d+64)) then
        tmp = 0.0d0 - x
    else if (z <= (-1.4d-36)) then
        tmp = x * (y / z)
    else if (z <= 3.8d-10) then
        tmp = x / z
    else if (z <= 3.2d+53) then
        tmp = y * (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 <= -4.9e+64) {
		tmp = 0.0 - x;
	} else if (z <= -1.4e-36) {
		tmp = x * (y / z);
	} else if (z <= 3.8e-10) {
		tmp = x / z;
	} else if (z <= 3.2e+53) {
		tmp = y * (x / z);
	} else {
		tmp = 0.0 - x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -4.9e+64:
		tmp = 0.0 - x
	elif z <= -1.4e-36:
		tmp = x * (y / z)
	elif z <= 3.8e-10:
		tmp = x / z
	elif z <= 3.2e+53:
		tmp = y * (x / z)
	else:
		tmp = 0.0 - x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -4.9e+64)
		tmp = Float64(0.0 - x);
	elseif (z <= -1.4e-36)
		tmp = Float64(x * Float64(y / z));
	elseif (z <= 3.8e-10)
		tmp = Float64(x / z);
	elseif (z <= 3.2e+53)
		tmp = Float64(y * 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 <= -4.9e+64)
		tmp = 0.0 - x;
	elseif (z <= -1.4e-36)
		tmp = x * (y / z);
	elseif (z <= 3.8e-10)
		tmp = x / z;
	elseif (z <= 3.2e+53)
		tmp = y * (x / z);
	else
		tmp = 0.0 - x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -4.9e+64], N[(0.0 - x), $MachinePrecision], If[LessEqual[z, -1.4e-36], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-10], N[(x / z), $MachinePrecision], If[LessEqual[z, 3.2e+53], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(0.0 - x), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{+64}:\\
\;\;\;\;0 - x\\

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{x}{z}\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.9000000000000003e64 or 3.2e53 < z

    1. Initial program 71.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-eval100.0%

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

      \[\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--.f6484.3%

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

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

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

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

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

    if -4.9000000000000003e64 < z < -1.4000000000000001e-36

    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-eval99.6%

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

      \[\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-/.f6476.4%

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

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

    if -1.4000000000000001e-36 < z < 3.7999999999999998e-10

    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-eval89.6%

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

      \[\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. *-rgt-identityN/A

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

        \[\leadsto \mathsf{neg}\left(\left(x - \frac{x \cdot 1}{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-/.f6465.5%

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

      \[\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-/.f6465.2%

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

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

    if 3.7999999999999998e-10 < z < 3.2e53

    1. Initial program 99.8%

      \[\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. Simplified64.6%

        \[\leadsto \color{blue}{y} \cdot \frac{x}{z} \]
    7. Recombined 4 regimes into one program.
    8. Final simplification73.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+64}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-10}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+53}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 65.1% accurate, 0.4× speedup?

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

      1. Initial program 71.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-eval100.0%

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

        \[\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--.f6484.3%

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

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

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

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

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

      if -4.09999999999999978e64 < z < -2.50000000000000002e-36 or 4.99999999999999977e-7 < z < 1.4499999999999999e55

      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-eval99.7%

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

        \[\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-/.f6471.7%

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

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

      if -2.50000000000000002e-36 < z < 4.99999999999999977e-7

      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-eval89.6%

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

        \[\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. *-rgt-identityN/A

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

          \[\leadsto \mathsf{neg}\left(\left(x - \frac{x \cdot 1}{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-/.f6465.5%

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

        \[\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-/.f6465.2%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+64}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+55}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 99.8% 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 -1.25 \cdot 10^{-8}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-32}:\\ \;\;\;\;\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 -1.25e-8) t_0 (if (<= z 2e-32) (/ (* 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 <= -1.25e-8) {
    		tmp = t_0;
    	} else if (z <= 2e-32) {
    		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 <= (-1.25d-8)) then
            tmp = t_0
        else if (z <= 2d-32) 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 <= -1.25e-8) {
    		tmp = t_0;
    	} else if (z <= 2e-32) {
    		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 <= -1.25e-8:
    		tmp = t_0
    	elif z <= 2e-32:
    		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 <= -1.25e-8)
    		tmp = t_0;
    	elseif (z <= 2e-32)
    		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 <= -1.25e-8)
    		tmp = t_0;
    	elseif (z <= 2e-32)
    		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, -1.25e-8], t$95$0, If[LessEqual[z, 2e-32], 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 -1.25 \cdot 10^{-8}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 2 \cdot 10^{-32}:\\
    \;\;\;\;\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 < -1.2499999999999999e-8 or 2.00000000000000011e-32 < z

      1. Initial program 78.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

      if -1.2499999999999999e-8 < z < 2.00000000000000011e-32

      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. Simplified99.9%

          \[\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 -1.25 \cdot 10^{-8}:\\ \;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-32}:\\ \;\;\;\;\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 5: 85.8% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+64}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+54}:\\ \;\;\;\;\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 -4.1e+64)
         (- 0.0 x)
         (if (<= z 3.4e+54) (/ (* x (+ y 1.0)) z) (- (/ x z) x))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (z <= -4.1e+64) {
      		tmp = 0.0 - x;
      	} else if (z <= 3.4e+54) {
      		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 <= (-4.1d+64)) then
              tmp = 0.0d0 - x
          else if (z <= 3.4d+54) 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 <= -4.1e+64) {
      		tmp = 0.0 - x;
      	} else if (z <= 3.4e+54) {
      		tmp = (x * (y + 1.0)) / z;
      	} else {
      		tmp = (x / z) - x;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if z <= -4.1e+64:
      		tmp = 0.0 - x
      	elif z <= 3.4e+54:
      		tmp = (x * (y + 1.0)) / z
      	else:
      		tmp = (x / z) - x
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (z <= -4.1e+64)
      		tmp = Float64(0.0 - x);
      	elseif (z <= 3.4e+54)
      		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 <= -4.1e+64)
      		tmp = 0.0 - x;
      	elseif (z <= 3.4e+54)
      		tmp = (x * (y + 1.0)) / z;
      	else
      		tmp = (x / z) - x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[z, -4.1e+64], N[(0.0 - x), $MachinePrecision], If[LessEqual[z, 3.4e+54], 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 -4.1 \cdot 10^{+64}:\\
      \;\;\;\;0 - x\\
      
      \mathbf{elif}\;z \leq 3.4 \cdot 10^{+54}:\\
      \;\;\;\;\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 < -4.09999999999999978e64

        1. Initial program 71.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-eval100.0%

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

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

            \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{x}\right) \]
        7. Simplified84.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.f6484.8%

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

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

        if -4.09999999999999978e64 < z < 3.4000000000000001e54

        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. Simplified94.7%

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

          if 3.4000000000000001e54 < z

          1. Initial program 70.4%

            \[\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-eval100.0%

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

            \[\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. *-rgt-identityN/A

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

              \[\leadsto \mathsf{neg}\left(\left(x - \frac{x \cdot 1}{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-/.f6483.8%

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

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

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

        Alternative 6: 84.5% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+50}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;y \leq 0.065:\\ \;\;\;\;\frac{x}{z} - x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= y -5e+50)
           (/ (* x y) z)
           (if (<= y 0.065) (- (/ x z) x) (* y (/ x z)))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -5e+50) {
        		tmp = (x * y) / z;
        	} else if (y <= 0.065) {
        		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 <= (-5d+50)) then
                tmp = (x * y) / z
            else if (y <= 0.065d0) 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 <= -5e+50) {
        		tmp = (x * y) / z;
        	} else if (y <= 0.065) {
        		tmp = (x / z) - x;
        	} else {
        		tmp = y * (x / z);
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	tmp = 0
        	if y <= -5e+50:
        		tmp = (x * y) / z
        	elif y <= 0.065:
        		tmp = (x / z) - x
        	else:
        		tmp = y * (x / z)
        	return tmp
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -5e+50)
        		tmp = Float64(Float64(x * y) / z);
        	elseif (y <= 0.065)
        		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 <= -5e+50)
        		tmp = (x * y) / z;
        	elseif (y <= 0.065)
        		tmp = (x / z) - x;
        	else
        		tmp = y * (x / z);
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -5e+50], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 0.065], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -5 \cdot 10^{+50}:\\
        \;\;\;\;\frac{x \cdot y}{z}\\
        
        \mathbf{elif}\;y \leq 0.065:\\
        \;\;\;\;\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 < -5e50

          1. Initial program 95.4%

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

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

            \[\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-*.f6482.3%

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

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

          if -5e50 < y < 0.065000000000000002

          1. Initial program 87.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.2%

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
          3. Simplified99.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. *-rgt-identityN/A

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

              \[\leadsto \mathsf{neg}\left(\left(x - \frac{x \cdot 1}{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-/.f6497.5%

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

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

          if 0.065000000000000002 < y

          1. Initial program 86.0%

            \[\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-/.f6485.2%

              \[\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-rr85.2%

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

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

          Alternative 7: 84.6% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \frac{x}{z}\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{+51}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 0.065:\\ \;\;\;\;\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 -4.8e+51) t_0 (if (<= y 0.065) (- (/ x z) x) t_0))))
          double code(double x, double y, double z) {
          	double t_0 = y * (x / z);
          	double tmp;
          	if (y <= -4.8e+51) {
          		tmp = t_0;
          	} else if (y <= 0.065) {
          		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 <= (-4.8d+51)) then
                  tmp = t_0
              else if (y <= 0.065d0) 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 <= -4.8e+51) {
          		tmp = t_0;
          	} else if (y <= 0.065) {
          		tmp = (x / z) - x;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	t_0 = y * (x / z)
          	tmp = 0
          	if y <= -4.8e+51:
          		tmp = t_0
          	elif y <= 0.065:
          		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 <= -4.8e+51)
          		tmp = t_0;
          	elseif (y <= 0.065)
          		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 <= -4.8e+51)
          		tmp = t_0;
          	elseif (y <= 0.065)
          		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, -4.8e+51], t$95$0, If[LessEqual[y, 0.065], 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 -4.8 \cdot 10^{+51}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;y \leq 0.065:\\
          \;\;\;\;\frac{x}{z} - x\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -4.7999999999999997e51 or 0.065000000000000002 < y

            1. Initial program 89.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-/.f6486.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-rr86.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. Simplified78.4%

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

              if -4.7999999999999997e51 < y < 0.065000000000000002

              1. Initial program 87.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.2%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
              3. Simplified99.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. *-rgt-identityN/A

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

                  \[\leadsto \mathsf{neg}\left(\left(x - \frac{x \cdot 1}{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-/.f6497.5%

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

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

            Alternative 8: 94.1% accurate, 0.6× speedup?

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

              1. Initial program 93.3%

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

              if 2.10000000000000001e-80 < x

              1. Initial program 76.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
            3. Recombined 2 regimes into one program.
            4. Final simplification95.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.1 \cdot 10^{-80}:\\ \;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 9: 65.0% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.155:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= z -0.155) (- 0.0 x) (if (<= z 1.0) (/ x z) (- 0.0 x))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (z <= -0.155) {
            		tmp = 0.0 - x;
            	} else if (z <= 1.0) {
            		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 <= (-0.155d0)) then
                    tmp = 0.0d0 - x
                else if (z <= 1.0d0) 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 <= -0.155) {
            		tmp = 0.0 - x;
            	} else if (z <= 1.0) {
            		tmp = x / z;
            	} else {
            		tmp = 0.0 - x;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if z <= -0.155:
            		tmp = 0.0 - x
            	elif z <= 1.0:
            		tmp = x / z
            	else:
            		tmp = 0.0 - x
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if (z <= -0.155)
            		tmp = Float64(0.0 - x);
            	elseif (z <= 1.0)
            		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 <= -0.155)
            		tmp = 0.0 - x;
            	elseif (z <= 1.0)
            		tmp = x / z;
            	else
            		tmp = 0.0 - x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[LessEqual[z, -0.155], N[(0.0 - x), $MachinePrecision], If[LessEqual[z, 1.0], N[(x / z), $MachinePrecision], N[(0.0 - x), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -0.155:\\
            \;\;\;\;0 - x\\
            
            \mathbf{elif}\;z \leq 1:\\
            \;\;\;\;\frac{x}{z}\\
            
            \mathbf{else}:\\
            \;\;\;\;0 - x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -0.154999999999999999 or 1 < z

              1. Initial program 77.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 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--.f6470.9%

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

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

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

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

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

              if -0.154999999999999999 < z < 1

              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-eval90.2%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(-1, y\right), z\right)\right)\right) \]
              3. Simplified90.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. *-rgt-identityN/A

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

                  \[\leadsto \mathsf{neg}\left(\left(x - \frac{x \cdot 1}{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-/.f6463.8%

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

                \[\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-/.f6462.7%

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.155:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
            5. Add Preprocessing

            Alternative 10: 38.8% 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 88.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-eval95.1%

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

              \[\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--.f6437.0%

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

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

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

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

              \[\leadsto \color{blue}{-x} \]
            10. Final simplification37.0%

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