Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1

Percentage Accurate: 100.0% → 100.0%
Time: 9.0s
Alternatives: 10
Speedup: 1.0×

Specification

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

\\
\frac{x - y}{z - y}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

\\
\frac{x - y}{z - y}
\end{array}

Alternative 1: 100.0% accurate, 0.6× speedup?

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

\\
\frac{y}{y - z} - \frac{x}{y - z}
\end{array}
Derivation
  1. Initial program 99.9%

    \[\frac{x - y}{z - y} \]
  2. Step-by-step derivation
    1. *-lft-identity99.9%

      \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
    2. metadata-eval99.9%

      \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
    3. associate-/r/99.2%

      \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
    4. associate-/l*99.1%

      \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
    5. neg-mul-199.1%

      \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
    6. sub-neg99.1%

      \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
    7. +-commutative99.1%

      \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
    8. distribute-neg-out99.1%

      \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
    9. remove-double-neg99.1%

      \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
    10. sub-neg99.1%

      \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
    11. associate-/l*99.9%

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
    12. neg-mul-199.9%

      \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
    13. sub-neg99.9%

      \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
    14. +-commutative99.9%

      \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
    15. distribute-neg-out99.9%

      \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
    16. remove-double-neg99.9%

      \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
    17. sub-neg99.9%

      \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
  4. Step-by-step derivation
    1. div-sub100.0%

      \[\leadsto \color{blue}{\frac{y}{y - z} - \frac{x}{y - z}} \]
  5. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\frac{y}{y - z} - \frac{x}{y - z}} \]
  6. Final simplification100.0%

    \[\leadsto \frac{y}{y - z} - \frac{x}{y - z} \]

Alternative 2: 76.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{y - z}\\ t_1 := \frac{-x}{y - z}\\ \mathbf{if}\;y \leq -8.8 \cdot 10^{+18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-71}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-19}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+89}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+115}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{z - x}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ y (- y z))) (t_1 (/ (- x) (- y z))))
   (if (<= y -8.8e+18)
     t_0
     (if (<= y 1.5e-71)
       t_1
       (if (<= y 8e-65)
         t_0
         (if (<= y 2.1e-19)
           t_1
           (if (<= y 4.2e+89)
             t_0
             (if (<= y 1.75e+115) t_1 (+ 1.0 (/ (- z x) y))))))))))
double code(double x, double y, double z) {
	double t_0 = y / (y - z);
	double t_1 = -x / (y - z);
	double tmp;
	if (y <= -8.8e+18) {
		tmp = t_0;
	} else if (y <= 1.5e-71) {
		tmp = t_1;
	} else if (y <= 8e-65) {
		tmp = t_0;
	} else if (y <= 2.1e-19) {
		tmp = t_1;
	} else if (y <= 4.2e+89) {
		tmp = t_0;
	} else if (y <= 1.75e+115) {
		tmp = t_1;
	} else {
		tmp = 1.0 + ((z - x) / y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = y / (y - z)
    t_1 = -x / (y - z)
    if (y <= (-8.8d+18)) then
        tmp = t_0
    else if (y <= 1.5d-71) then
        tmp = t_1
    else if (y <= 8d-65) then
        tmp = t_0
    else if (y <= 2.1d-19) then
        tmp = t_1
    else if (y <= 4.2d+89) then
        tmp = t_0
    else if (y <= 1.75d+115) then
        tmp = t_1
    else
        tmp = 1.0d0 + ((z - x) / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y / (y - z);
	double t_1 = -x / (y - z);
	double tmp;
	if (y <= -8.8e+18) {
		tmp = t_0;
	} else if (y <= 1.5e-71) {
		tmp = t_1;
	} else if (y <= 8e-65) {
		tmp = t_0;
	} else if (y <= 2.1e-19) {
		tmp = t_1;
	} else if (y <= 4.2e+89) {
		tmp = t_0;
	} else if (y <= 1.75e+115) {
		tmp = t_1;
	} else {
		tmp = 1.0 + ((z - x) / y);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y / (y - z)
	t_1 = -x / (y - z)
	tmp = 0
	if y <= -8.8e+18:
		tmp = t_0
	elif y <= 1.5e-71:
		tmp = t_1
	elif y <= 8e-65:
		tmp = t_0
	elif y <= 2.1e-19:
		tmp = t_1
	elif y <= 4.2e+89:
		tmp = t_0
	elif y <= 1.75e+115:
		tmp = t_1
	else:
		tmp = 1.0 + ((z - x) / y)
	return tmp
function code(x, y, z)
	t_0 = Float64(y / Float64(y - z))
	t_1 = Float64(Float64(-x) / Float64(y - z))
	tmp = 0.0
	if (y <= -8.8e+18)
		tmp = t_0;
	elseif (y <= 1.5e-71)
		tmp = t_1;
	elseif (y <= 8e-65)
		tmp = t_0;
	elseif (y <= 2.1e-19)
		tmp = t_1;
	elseif (y <= 4.2e+89)
		tmp = t_0;
	elseif (y <= 1.75e+115)
		tmp = t_1;
	else
		tmp = Float64(1.0 + Float64(Float64(z - x) / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y / (y - z);
	t_1 = -x / (y - z);
	tmp = 0.0;
	if (y <= -8.8e+18)
		tmp = t_0;
	elseif (y <= 1.5e-71)
		tmp = t_1;
	elseif (y <= 8e-65)
		tmp = t_0;
	elseif (y <= 2.1e-19)
		tmp = t_1;
	elseif (y <= 4.2e+89)
		tmp = t_0;
	elseif (y <= 1.75e+115)
		tmp = t_1;
	else
		tmp = 1.0 + ((z - x) / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.8e+18], t$95$0, If[LessEqual[y, 1.5e-71], t$95$1, If[LessEqual[y, 8e-65], t$95$0, If[LessEqual[y, 2.1e-19], t$95$1, If[LessEqual[y, 4.2e+89], t$95$0, If[LessEqual[y, 1.75e+115], t$95$1, N[(1.0 + N[(N[(z - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y}{y - z}\\
t_1 := \frac{-x}{y - z}\\
\mathbf{if}\;y \leq -8.8 \cdot 10^{+18}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-71}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 8 \cdot 10^{-65}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-19}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+89}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{+115}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;1 + \frac{z - x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.8e18 or 1.5000000000000001e-71 < y < 7.99999999999999939e-65 or 2.0999999999999999e-19 < y < 4.19999999999999972e89

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.5%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.4%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.4%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.4%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.4%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.4%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.4%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.4%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in x around 0 88.9%

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

    if -8.8e18 < y < 1.5000000000000001e-71 or 7.99999999999999939e-65 < y < 2.0999999999999999e-19 or 4.19999999999999972e89 < y < 1.75000000000000003e115

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/98.9%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*98.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-198.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg98.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative98.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in x around inf 88.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y - z}} \]
    5. Step-by-step derivation
      1. neg-mul-188.9%

        \[\leadsto \color{blue}{-\frac{x}{y - z}} \]
      2. distribute-neg-frac88.9%

        \[\leadsto \color{blue}{\frac{-x}{y - z}} \]
    6. Simplified88.9%

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

    if 1.75000000000000003e115 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.9%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in y around inf 78.6%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \frac{x}{y}\right) - -1 \cdot \frac{z}{y}} \]
    5. Step-by-step derivation
      1. associate--l+78.6%

        \[\leadsto \color{blue}{1 + \left(-1 \cdot \frac{x}{y} - -1 \cdot \frac{z}{y}\right)} \]
      2. distribute-lft-out--78.6%

        \[\leadsto 1 + \color{blue}{-1 \cdot \left(\frac{x}{y} - \frac{z}{y}\right)} \]
      3. div-sub78.6%

        \[\leadsto 1 + -1 \cdot \color{blue}{\frac{x - z}{y}} \]
      4. mul-1-neg78.6%

        \[\leadsto 1 + \color{blue}{\left(-\frac{x - z}{y}\right)} \]
      5. unsub-neg78.6%

        \[\leadsto \color{blue}{1 - \frac{x - z}{y}} \]
    6. Simplified78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.8 \cdot 10^{+18}:\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-71}:\\ \;\;\;\;\frac{-x}{y - z}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-65}:\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-19}:\\ \;\;\;\;\frac{-x}{y - z}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+89}:\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+115}:\\ \;\;\;\;\frac{-x}{y - z}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{z - x}{y}\\ \end{array} \]

Alternative 3: 76.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.06 \cdot 10^{+20} \lor \neg \left(y \leq 1.32 \cdot 10^{-71} \lor \neg \left(y \leq 1.15 \cdot 10^{-65}\right) \land \left(y \leq 2.2 \cdot 10^{-15} \lor \neg \left(y \leq 1.52 \cdot 10^{+91}\right) \land y \leq 8.4 \cdot 10^{+122}\right)\right):\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{y - z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -1.06e+20)
         (not
          (or (<= y 1.32e-71)
              (and (not (<= y 1.15e-65))
                   (or (<= y 2.2e-15)
                       (and (not (<= y 1.52e+91)) (<= y 8.4e+122)))))))
   (/ y (- y z))
   (/ (- x) (- y z))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.06e+20) || !((y <= 1.32e-71) || (!(y <= 1.15e-65) && ((y <= 2.2e-15) || (!(y <= 1.52e+91) && (y <= 8.4e+122)))))) {
		tmp = y / (y - z);
	} else {
		tmp = -x / (y - z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-1.06d+20)) .or. (.not. (y <= 1.32d-71) .or. (.not. (y <= 1.15d-65)) .and. (y <= 2.2d-15) .or. (.not. (y <= 1.52d+91)) .and. (y <= 8.4d+122))) then
        tmp = y / (y - z)
    else
        tmp = -x / (y - z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.06e+20) || !((y <= 1.32e-71) || (!(y <= 1.15e-65) && ((y <= 2.2e-15) || (!(y <= 1.52e+91) && (y <= 8.4e+122)))))) {
		tmp = y / (y - z);
	} else {
		tmp = -x / (y - z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -1.06e+20) or not ((y <= 1.32e-71) or (not (y <= 1.15e-65) and ((y <= 2.2e-15) or (not (y <= 1.52e+91) and (y <= 8.4e+122))))):
		tmp = y / (y - z)
	else:
		tmp = -x / (y - z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -1.06e+20) || !((y <= 1.32e-71) || (!(y <= 1.15e-65) && ((y <= 2.2e-15) || (!(y <= 1.52e+91) && (y <= 8.4e+122))))))
		tmp = Float64(y / Float64(y - z));
	else
		tmp = Float64(Float64(-x) / Float64(y - z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -1.06e+20) || ~(((y <= 1.32e-71) || (~((y <= 1.15e-65)) && ((y <= 2.2e-15) || (~((y <= 1.52e+91)) && (y <= 8.4e+122)))))))
		tmp = y / (y - z);
	else
		tmp = -x / (y - z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.06e+20], N[Not[Or[LessEqual[y, 1.32e-71], And[N[Not[LessEqual[y, 1.15e-65]], $MachinePrecision], Or[LessEqual[y, 2.2e-15], And[N[Not[LessEqual[y, 1.52e+91]], $MachinePrecision], LessEqual[y, 8.4e+122]]]]]], $MachinePrecision]], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+20} \lor \neg \left(y \leq 1.32 \cdot 10^{-71} \lor \neg \left(y \leq 1.15 \cdot 10^{-65}\right) \land \left(y \leq 2.2 \cdot 10^{-15} \lor \neg \left(y \leq 1.52 \cdot 10^{+91}\right) \land y \leq 8.4 \cdot 10^{+122}\right)\right):\\
\;\;\;\;\frac{y}{y - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{y - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.06e20 or 1.32e-71 < y < 1.15e-65 or 2.19999999999999986e-15 < y < 1.52e91 or 8.40000000000000063e122 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.6%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.5%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.5%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.5%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in x around 0 85.7%

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

    if -1.06e20 < y < 1.32e-71 or 1.15e-65 < y < 2.19999999999999986e-15 or 1.52e91 < y < 8.40000000000000063e122

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/98.9%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*98.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-198.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg98.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative98.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in x around inf 89.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y - z}} \]
    5. Step-by-step derivation
      1. neg-mul-189.0%

        \[\leadsto \color{blue}{-\frac{x}{y - z}} \]
      2. distribute-neg-frac89.0%

        \[\leadsto \color{blue}{\frac{-x}{y - z}} \]
    6. Simplified89.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.06 \cdot 10^{+20} \lor \neg \left(y \leq 1.32 \cdot 10^{-71} \lor \neg \left(y \leq 1.15 \cdot 10^{-65}\right) \land \left(y \leq 2.2 \cdot 10^{-15} \lor \neg \left(y \leq 1.52 \cdot 10^{+91}\right) \land y \leq 8.4 \cdot 10^{+122}\right)\right):\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{y - z}\\ \end{array} \]

Alternative 4: 71.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{y}{y - z}\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{+38}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -2.4 \cdot 10^{-92}:\\
\;\;\;\;1 - \frac{x}{y}\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.7999999999999998e38 or 7.99999999999999942e-76 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.7%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.5%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.5%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.5%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in x around 0 77.2%

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

    if -3.7999999999999998e38 < y < -2.4000000000000001e-92

    1. Initial program 99.8%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.8%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.8%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/97.9%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*98.0%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-198.0%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg98.0%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative98.0%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out98.0%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg98.0%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg98.0%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.8%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.8%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.8%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.8%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.8%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in z around 0 56.1%

      \[\leadsto \color{blue}{\frac{y - x}{y}} \]
    5. Step-by-step derivation
      1. div-sub56.1%

        \[\leadsto \color{blue}{\frac{y}{y} - \frac{x}{y}} \]
      2. *-inverses56.1%

        \[\leadsto \color{blue}{1} - \frac{x}{y} \]
    6. Simplified56.1%

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

    if -2.4000000000000001e-92 < y < 7.99999999999999942e-76

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity100.0%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval100.0%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.1%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*98.9%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-198.9%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg98.9%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative98.9%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out98.9%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg98.9%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg98.9%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*100.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-1100.0%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg100.0%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative100.0%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out100.0%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg100.0%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg100.0%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in y around 0 82.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{+38}:\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-92}:\\ \;\;\;\;1 - \frac{x}{y}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{y - z}\\ \end{array} \]

Alternative 5: 71.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-91} \lor \neg \left(y \leq 1.7 \cdot 10^{-46}\right):\\ \;\;\;\;1 - \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -2.7e-91) (not (<= y 1.7e-46))) (- 1.0 (/ x y)) (/ x z)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -2.7e-91) || !(y <= 1.7e-46)) {
		tmp = 1.0 - (x / y);
	} else {
		tmp = x / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-2.7d-91)) .or. (.not. (y <= 1.7d-46))) then
        tmp = 1.0d0 - (x / y)
    else
        tmp = x / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -2.7e-91) || !(y <= 1.7e-46)) {
		tmp = 1.0 - (x / y);
	} else {
		tmp = x / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -2.7e-91) or not (y <= 1.7e-46):
		tmp = 1.0 - (x / y)
	else:
		tmp = x / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -2.7e-91) || !(y <= 1.7e-46))
		tmp = Float64(1.0 - Float64(x / y));
	else
		tmp = Float64(x / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -2.7e-91) || ~((y <= 1.7e-46)))
		tmp = 1.0 - (x / y);
	else
		tmp = x / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.7e-91], N[Not[LessEqual[y, 1.7e-46]], $MachinePrecision]], N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-91} \lor \neg \left(y \leq 1.7 \cdot 10^{-46}\right):\\
\;\;\;\;1 - \frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.6999999999999997e-91 or 1.69999999999999998e-46 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.5%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.4%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.4%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.4%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.4%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.4%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.4%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.4%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in z around 0 65.6%

      \[\leadsto \color{blue}{\frac{y - x}{y}} \]
    5. Step-by-step derivation
      1. div-sub65.6%

        \[\leadsto \color{blue}{\frac{y}{y} - \frac{x}{y}} \]
      2. *-inverses65.6%

        \[\leadsto \color{blue}{1} - \frac{x}{y} \]
    6. Simplified65.6%

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

    if -2.6999999999999997e-91 < y < 1.69999999999999998e-46

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity100.0%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval100.0%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/98.9%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*98.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-198.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg98.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative98.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg98.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*100.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-1100.0%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg100.0%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative100.0%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out100.0%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg100.0%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg100.0%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in y around 0 78.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-91} \lor \neg \left(y \leq 1.7 \cdot 10^{-46}\right):\\ \;\;\;\;1 - \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 6: 76.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.8 \cdot 10^{+19} \lor \neg \left(y \leq 1.6 \cdot 10^{-46}\right):\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -9.8e+19) (not (<= y 1.6e-46))) (/ y (- y z)) (/ (- x y) z)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -9.8e+19) || !(y <= 1.6e-46)) {
		tmp = y / (y - z);
	} else {
		tmp = (x - y) / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-9.8d+19)) .or. (.not. (y <= 1.6d-46))) then
        tmp = y / (y - z)
    else
        tmp = (x - y) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -9.8e+19) || !(y <= 1.6e-46)) {
		tmp = y / (y - z);
	} else {
		tmp = (x - y) / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -9.8e+19) or not (y <= 1.6e-46):
		tmp = y / (y - z)
	else:
		tmp = (x - y) / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -9.8e+19) || !(y <= 1.6e-46))
		tmp = Float64(y / Float64(y - z));
	else
		tmp = Float64(Float64(x - y) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -9.8e+19) || ~((y <= 1.6e-46)))
		tmp = y / (y - z);
	else
		tmp = (x - y) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -9.8e+19], N[Not[LessEqual[y, 1.6e-46]], $MachinePrecision]], N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.8 \cdot 10^{+19} \lor \neg \left(y \leq 1.6 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{y}{y - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.8e19 or 1.6e-46 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.8%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in x around 0 78.4%

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

    if -9.8e19 < y < 1.6e-46

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity100.0%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval100.0%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/98.7%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*98.5%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-198.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg98.5%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative98.5%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out98.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg98.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg98.5%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*100.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-1100.0%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg100.0%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative100.0%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out100.0%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg100.0%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg100.0%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in z around inf 78.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{y - x}{z}} \]
    5. Step-by-step derivation
      1. associate-*r/78.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(y - x\right)}{z}} \]
      2. neg-mul-178.4%

        \[\leadsto \frac{\color{blue}{-\left(y - x\right)}}{z} \]
      3. neg-sub078.4%

        \[\leadsto \frac{\color{blue}{0 - \left(y - x\right)}}{z} \]
      4. associate--r-78.4%

        \[\leadsto \frac{\color{blue}{\left(0 - y\right) + x}}{z} \]
      5. neg-sub078.4%

        \[\leadsto \frac{\color{blue}{\left(-y\right)} + x}{z} \]
    6. Simplified78.4%

      \[\leadsto \color{blue}{\frac{\left(-y\right) + x}{z}} \]
    7. Taylor expanded in y around 0 78.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{z} + \frac{x}{z}} \]
    8. Step-by-step derivation
      1. +-commutative78.4%

        \[\leadsto \color{blue}{\frac{x}{z} + -1 \cdot \frac{y}{z}} \]
      2. mul-1-neg78.4%

        \[\leadsto \frac{x}{z} + \color{blue}{\left(-\frac{y}{z}\right)} \]
      3. sub-neg78.4%

        \[\leadsto \color{blue}{\frac{x}{z} - \frac{y}{z}} \]
      4. div-sub78.4%

        \[\leadsto \color{blue}{\frac{x - y}{z}} \]
    9. Simplified78.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.8 \cdot 10^{+19} \lor \neg \left(y \leq 1.6 \cdot 10^{-46}\right):\\ \;\;\;\;\frac{y}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z}\\ \end{array} \]

Alternative 7: 62.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+17}:\\
\;\;\;\;1\\

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

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.15e17 or 1.08000000000000002e-10 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.8%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in y around inf 54.7%

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

    if -2.15e17 < y < 1.08000000000000002e-10

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity100.0%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval100.0%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/98.7%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*98.6%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-198.6%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg98.6%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative98.6%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out98.6%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg98.6%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg98.6%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*100.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-1100.0%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg100.0%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative100.0%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out100.0%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg100.0%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg100.0%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in y around 0 68.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{+17}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.08 \cdot 10^{-10}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 8: 62.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.18 \cdot 10^{+38}:\\
\;\;\;\;1 + \frac{z}{y}\\

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

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.18e38

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.8%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in x around 0 88.3%

      \[\leadsto \color{blue}{\frac{y}{y - z}} \]
    5. Taylor expanded in y around inf 59.3%

      \[\leadsto \color{blue}{1 + \frac{z}{y}} \]

    if -1.18e38 < y < 1.05e-10

    1. Initial program 100.0%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity100.0%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval100.0%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/98.7%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*98.6%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-198.6%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg98.6%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative98.6%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out98.6%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg98.6%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg98.6%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*100.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-1100.0%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg100.0%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative100.0%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out100.0%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg100.0%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg100.0%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in y around 0 67.7%

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

    if 1.05e-10 < y

    1. Initial program 99.9%

      \[\frac{x - y}{z - y} \]
    2. Step-by-step derivation
      1. *-lft-identity99.9%

        \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
      2. metadata-eval99.9%

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
      3. associate-/r/99.8%

        \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
      4. associate-/l*99.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
      5. neg-mul-199.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
      6. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
      7. +-commutative99.7%

        \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
      8. distribute-neg-out99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
      9. remove-double-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
      10. sub-neg99.7%

        \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
      11. associate-/l*99.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
      12. neg-mul-199.9%

        \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
      13. sub-neg99.9%

        \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
      14. +-commutative99.9%

        \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
      15. distribute-neg-out99.9%

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
      16. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
      17. sub-neg99.9%

        \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
    4. Taylor expanded in y around inf 51.1%

      \[\leadsto \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.18 \cdot 10^{+38}:\\ \;\;\;\;1 + \frac{z}{y}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-10}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 9: 100.0% accurate, 1.0× speedup?

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

\\
\frac{x - y}{z - y}
\end{array}
Derivation
  1. Initial program 99.9%

    \[\frac{x - y}{z - y} \]
  2. Final simplification99.9%

    \[\leadsto \frac{x - y}{z - y} \]

Alternative 10: 34.4% accurate, 7.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 99.9%

    \[\frac{x - y}{z - y} \]
  2. Step-by-step derivation
    1. *-lft-identity99.9%

      \[\leadsto \color{blue}{1 \cdot \frac{x - y}{z - y}} \]
    2. metadata-eval99.9%

      \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{x - y}{z - y} \]
    3. associate-/r/99.2%

      \[\leadsto \color{blue}{\frac{-1}{\frac{-1}{\frac{x - y}{z - y}}}} \]
    4. associate-/l*99.1%

      \[\leadsto \frac{-1}{\color{blue}{\frac{-1 \cdot \left(z - y\right)}{x - y}}} \]
    5. neg-mul-199.1%

      \[\leadsto \frac{-1}{\frac{\color{blue}{-\left(z - y\right)}}{x - y}} \]
    6. sub-neg99.1%

      \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(z + \left(-y\right)\right)}}{x - y}} \]
    7. +-commutative99.1%

      \[\leadsto \frac{-1}{\frac{-\color{blue}{\left(\left(-y\right) + z\right)}}{x - y}} \]
    8. distribute-neg-out99.1%

      \[\leadsto \frac{-1}{\frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-z\right)}}{x - y}} \]
    9. remove-double-neg99.1%

      \[\leadsto \frac{-1}{\frac{\color{blue}{y} + \left(-z\right)}{x - y}} \]
    10. sub-neg99.1%

      \[\leadsto \frac{-1}{\frac{\color{blue}{y - z}}{x - y}} \]
    11. associate-/l*99.9%

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(x - y\right)}{y - z}} \]
    12. neg-mul-199.9%

      \[\leadsto \frac{\color{blue}{-\left(x - y\right)}}{y - z} \]
    13. sub-neg99.9%

      \[\leadsto \frac{-\color{blue}{\left(x + \left(-y\right)\right)}}{y - z} \]
    14. +-commutative99.9%

      \[\leadsto \frac{-\color{blue}{\left(\left(-y\right) + x\right)}}{y - z} \]
    15. distribute-neg-out99.9%

      \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) + \left(-x\right)}}{y - z} \]
    16. remove-double-neg99.9%

      \[\leadsto \frac{\color{blue}{y} + \left(-x\right)}{y - z} \]
    17. sub-neg99.9%

      \[\leadsto \frac{\color{blue}{y - x}}{y - z} \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{\frac{y - x}{y - z}} \]
  4. Taylor expanded in y around inf 31.1%

    \[\leadsto \color{blue}{1} \]
  5. Final simplification31.1%

    \[\leadsto 1 \]

Developer target: 100.0% accurate, 0.6× speedup?

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

\\
\frac{x}{z - y} - \frac{y}{z - y}
\end{array}

Reproduce

?
herbie shell --seed 2023333 
(FPCore (x y z)
  :name "Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1"
  :precision binary64

  :herbie-target
  (- (/ x (- z y)) (/ y (- z y)))

  (/ (- x y) (- z y)))