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

Percentage Accurate: 88.4% → 99.8%
Time: 8.2s
Alternatives: 9
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 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.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.8 \cdot 10^{+36}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-19}:\\ \;\;\;\;\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 -1.8e+36) t_0 (if (<= z 5e-19) (* (+ (- 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 <= -1.8e+36) {
		tmp = t_0;
	} else if (z <= 5e-19) {
		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 <= (-1.8d+36)) then
        tmp = t_0
    else if (z <= 5d-19) 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 <= -1.8e+36) {
		tmp = t_0;
	} else if (z <= 5e-19) {
		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 <= -1.8e+36:
		tmp = t_0
	elif z <= 5e-19:
		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 <= -1.8e+36)
		tmp = t_0;
	elseif (z <= 5e-19)
		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 <= -1.8e+36)
		tmp = t_0;
	elseif (z <= 5e-19)
		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, -1.8e+36], t$95$0, If[LessEqual[z, 5e-19], 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 -1.8 \cdot 10^{+36}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 5 \cdot 10^{-19}:\\
\;\;\;\;\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 < -1.7999999999999999e36 or 5.0000000000000004e-19 < z

    1. Initial program 75.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-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.7999999999999999e36 < z < 5.0000000000000004e-19

    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 -1.8 \cdot 10^{+36}:\\ \;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-19}:\\ \;\;\;\;\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: 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 -1.9 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-20}:\\ \;\;\;\;\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.9e-16) t_0 (if (<= z 5e-20) (/ (* 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.9e-16) {
		tmp = t_0;
	} else if (z <= 5e-20) {
		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.9d-16)) then
        tmp = t_0
    else if (z <= 5d-20) 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.9e-16) {
		tmp = t_0;
	} else if (z <= 5e-20) {
		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.9e-16:
		tmp = t_0
	elif z <= 5e-20:
		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.9e-16)
		tmp = t_0;
	elseif (z <= 5e-20)
		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.9e-16)
		tmp = t_0;
	elseif (z <= 5e-20)
		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.9e-16], t$95$0, If[LessEqual[z, 5e-20], 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.9 \cdot 10^{-16}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\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.90000000000000006e-16 or 4.9999999999999999e-20 < z

    1. Initial program 77.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-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.90000000000000006e-16 < z < 4.9999999999999999e-20

    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.9 \cdot 10^{-16}:\\ \;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-20}:\\ \;\;\;\;\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 3: 64.9% accurate, 0.5× speedup?

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

      1. Initial program 74.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-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--.f6482.7%

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

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

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

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

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

      if -1.35e50 < z < 7.3000000000000001e-242

      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}} \]
      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.3%

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

        if 7.3000000000000001e-242 < 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-eval92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+50}:\\ \;\;\;\;0 - x\\ \mathbf{elif}\;z \leq 7.3 \cdot 10^{-242}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;0 - x\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 64.9% accurate, 0.5× speedup?

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

        1. Initial program 74.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-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--.f6482.7%

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

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

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

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

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

        if -1.59999999999999991e50 < z < -2.20000000000000014e-126

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

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

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

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

        if -2.20000000000000014e-126 < 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.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 5: 86.3% accurate, 0.5× speedup?

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

        1. Initial program 74.2%

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

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

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

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

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

        if -2.7999999999999998e50 < z < 2.29999999999999994e40

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

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

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

        Alternative 6: 85.7% accurate, 0.6× speedup?

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

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

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

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

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

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

            if -2.7e41 < y < 3.90000000000000019e34

            1. Initial program 85.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-eval99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 7: 94.0% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.22 \cdot 10^{-20}:\\ \;\;\;\;\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 1.22e-20)
             (/ (* 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 <= 1.22e-20) {
          		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 <= 1.22d-20) 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 <= 1.22e-20) {
          		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 <= 1.22e-20:
          		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 <= 1.22e-20)
          		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 <= 1.22e-20)
          		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, 1.22e-20], 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 1.22 \cdot 10^{-20}:\\
          \;\;\;\;\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 < 1.22000000000000003e-20

            1. Initial program 90.2%

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

            if 1.22000000000000003e-20 < x

            1. Initial program 74.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.8%

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.22 \cdot 10^{-20}:\\ \;\;\;\;\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 8: 64.8% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;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 -1.0) (- 0.0 x) (if (<= z 1.0) (/ x z) (- 0.0 x))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (z <= -1.0) {
          		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 <= (-1.0d0)) 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 <= -1.0) {
          		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 <= -1.0:
          		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 <= -1.0)
          		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 <= -1.0)
          		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, -1.0], 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 -1:\\
          \;\;\;\;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 < -1 or 1 < z

            1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(1\right)\right), y\right), z\right)\right)\right) \]
              23. metadata-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--.f6479.3%

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

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

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

            if -1 < 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-eval92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 9: 38.6% 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 87.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-eval96.6%

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

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

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

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

            \[\leadsto \color{blue}{-x} \]
          10. Final simplification45.9%

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

          Developer Target 1: 99.4% 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 2024163 
          (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))