Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3

Percentage Accurate: 84.4% → 97.9%
Time: 7.4s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot \left(y - z\right)}{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 * Float64(y - z)) / y)
end
function tmp = code(x, y, z)
	tmp = (x * (y - z)) / y;
end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot \left(y - z\right)}{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: 84.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot \left(y - z\right)}{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 * Float64(y - z)) / y)
end
function tmp = code(x, y, z)
	tmp = (x * (y - z)) / y;
end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 97.9% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 4 \cdot 10^{-45}:\\ \;\;\;\;x\_m + \frac{-1}{\frac{y}{x\_m \cdot z}}\\ \mathbf{else}:\\ \;\;\;\;x\_m - \frac{x\_m}{\frac{y}{z}}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= x_m 4e-45)
    (+ x_m (/ -1.0 (/ y (* x_m z))))
    (- x_m (/ x_m (/ y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (x_m <= 4e-45) {
		tmp = x_m + (-1.0 / (y / (x_m * z)));
	} else {
		tmp = x_m - (x_m / (y / z));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x_m <= 4d-45) then
        tmp = x_m + ((-1.0d0) / (y / (x_m * z)))
    else
        tmp = x_m - (x_m / (y / z))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (x_m <= 4e-45) {
		tmp = x_m + (-1.0 / (y / (x_m * z)));
	} else {
		tmp = x_m - (x_m / (y / z));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	tmp = 0
	if x_m <= 4e-45:
		tmp = x_m + (-1.0 / (y / (x_m * z)))
	else:
		tmp = x_m - (x_m / (y / z))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (x_m <= 4e-45)
		tmp = Float64(x_m + Float64(-1.0 / Float64(y / Float64(x_m * z))));
	else
		tmp = Float64(x_m - Float64(x_m / Float64(y / z)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z)
	tmp = 0.0;
	if (x_m <= 4e-45)
		tmp = x_m + (-1.0 / (y / (x_m * z)));
	else
		tmp = x_m - (x_m / (y / z));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[x$95$m, 4e-45], N[(x$95$m + N[(-1.0 / N[(y / N[(x$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m - N[(x$95$m / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 4 \cdot 10^{-45}:\\
\;\;\;\;x\_m + \frac{-1}{\frac{y}{x\_m \cdot z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.99999999999999994e-45

    1. Initial program 89.4%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg89.4%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg289.4%

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

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in89.4%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*94.5%

        \[\leadsto \color{blue}{x \cdot \frac{-\left(y - z\right)}{-y}} \]
      6. distribute-frac-neg94.5%

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg294.5%

        \[\leadsto x \cdot \left(-\color{blue}{\left(-\frac{y - z}{y}\right)}\right) \]
      8. remove-double-neg94.5%

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub94.5%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses94.5%

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

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z}{y}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg94.5%

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

        \[\leadsto \color{blue}{1 \cdot x + \left(-\frac{z}{y}\right) \cdot x} \]
      3. *-un-lft-identity94.5%

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

        \[\leadsto x + \color{blue}{\frac{z}{-y}} \cdot x \]
    6. Applied egg-rr94.5%

      \[\leadsto \color{blue}{x + \frac{z}{-y} \cdot x} \]
    7. Step-by-step derivation
      1. *-commutative94.5%

        \[\leadsto x + \color{blue}{x \cdot \frac{z}{-y}} \]
      2. distribute-frac-neg294.5%

        \[\leadsto x + x \cdot \color{blue}{\left(-\frac{z}{y}\right)} \]
      3. distribute-rgt-neg-out94.5%

        \[\leadsto x + \color{blue}{\left(-x \cdot \frac{z}{y}\right)} \]
      4. distribute-lft-neg-out94.5%

        \[\leadsto x + \color{blue}{\left(-x\right) \cdot \frac{z}{y}} \]
      5. associate-/l*95.4%

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

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

        \[\leadsto x + \color{blue}{\frac{-1}{-\frac{y}{\left(-x\right) \cdot z}}} \]
      8. metadata-eval95.4%

        \[\leadsto x + \frac{\color{blue}{-1}}{-\frac{y}{\left(-x\right) \cdot z}} \]
      9. frac-2neg95.4%

        \[\leadsto x + \frac{-1}{-\color{blue}{\frac{-y}{-\left(-x\right) \cdot z}}} \]
      10. add-sqr-sqrt51.1%

        \[\leadsto x + \frac{-1}{-\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{-\left(-x\right) \cdot z}} \]
      11. sqrt-unprod68.5%

        \[\leadsto x + \frac{-1}{-\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-\left(-x\right) \cdot z}} \]
      12. sqr-neg68.5%

        \[\leadsto x + \frac{-1}{-\frac{\sqrt{\color{blue}{y \cdot y}}}{-\left(-x\right) \cdot z}} \]
      13. sqrt-unprod24.8%

        \[\leadsto x + \frac{-1}{-\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\left(-x\right) \cdot z}} \]
      14. add-sqr-sqrt53.4%

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

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

        \[\leadsto x + \frac{-1}{-\frac{y}{\color{blue}{x \cdot z}}} \]
      17. distribute-frac-neg253.4%

        \[\leadsto x + \frac{-1}{\color{blue}{\frac{y}{-x \cdot z}}} \]
      18. distribute-lft-neg-out53.4%

        \[\leadsto x + \frac{-1}{\frac{y}{\color{blue}{\left(-x\right) \cdot z}}} \]
      19. frac-2neg53.4%

        \[\leadsto x + \frac{-1}{\color{blue}{\frac{-y}{-\left(-x\right) \cdot z}}} \]
      20. add-sqr-sqrt28.5%

        \[\leadsto x + \frac{-1}{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{-\left(-x\right) \cdot z}} \]
      21. sqrt-unprod62.9%

        \[\leadsto x + \frac{-1}{\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-\left(-x\right) \cdot z}} \]
      22. sqr-neg62.9%

        \[\leadsto x + \frac{-1}{\frac{\sqrt{\color{blue}{y \cdot y}}}{-\left(-x\right) \cdot z}} \]
      23. sqrt-unprod44.2%

        \[\leadsto x + \frac{-1}{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\left(-x\right) \cdot z}} \]
      24. add-sqr-sqrt95.4%

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

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

        \[\leadsto x + \frac{-1}{\frac{y}{\color{blue}{x \cdot z}}} \]
      27. *-commutative95.4%

        \[\leadsto x + \frac{-1}{\frac{y}{\color{blue}{z \cdot x}}} \]
    8. Applied egg-rr95.4%

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

    if 3.99999999999999994e-45 < x

    1. Initial program 85.5%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg85.5%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg285.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
      3. distribute-frac-neg85.5%

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in85.5%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*99.9%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg299.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub99.8%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses99.8%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{z}{y}\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z}{y}\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg99.8%

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

        \[\leadsto \color{blue}{1 \cdot x + \left(-\frac{z}{y}\right) \cdot x} \]
      3. *-un-lft-identity99.9%

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

        \[\leadsto x + \color{blue}{\frac{z}{-y}} \cdot x \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{x + \frac{z}{-y} \cdot x} \]
    7. Taylor expanded in z around 0 92.0%

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

        \[\leadsto x + \color{blue}{\left(-\frac{x \cdot z}{y}\right)} \]
      2. associate-*l/91.7%

        \[\leadsto x + \left(-\color{blue}{\frac{x}{y} \cdot z}\right) \]
      3. associate-/r/100.0%

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

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

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

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

Alternative 2: 67.3% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+176} \lor \neg \left(z \leq -6 \cdot 10^{+85} \lor \neg \left(z \leq -4.4 \cdot 10^{+54}\right) \land z \leq 2.7 \cdot 10^{+20}\right):\\ \;\;\;\;x\_m \cdot \frac{-z}{y}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (or (<= z -7.8e+176)
          (not (or (<= z -6e+85) (and (not (<= z -4.4e+54)) (<= z 2.7e+20)))))
    (* x_m (/ (- z) y))
    x_m)))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if ((z <= -7.8e+176) || !((z <= -6e+85) || (!(z <= -4.4e+54) && (z <= 2.7e+20)))) {
		tmp = x_m * (-z / y);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-7.8d+176)) .or. (.not. (z <= (-6d+85)) .or. (.not. (z <= (-4.4d+54))) .and. (z <= 2.7d+20))) then
        tmp = x_m * (-z / y)
    else
        tmp = x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if ((z <= -7.8e+176) || !((z <= -6e+85) || (!(z <= -4.4e+54) && (z <= 2.7e+20)))) {
		tmp = x_m * (-z / y);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	tmp = 0
	if (z <= -7.8e+176) or not ((z <= -6e+85) or (not (z <= -4.4e+54) and (z <= 2.7e+20))):
		tmp = x_m * (-z / y)
	else:
		tmp = x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	tmp = 0.0
	if ((z <= -7.8e+176) || !((z <= -6e+85) || (!(z <= -4.4e+54) && (z <= 2.7e+20))))
		tmp = Float64(x_m * Float64(Float64(-z) / y));
	else
		tmp = x_m;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z)
	tmp = 0.0;
	if ((z <= -7.8e+176) || ~(((z <= -6e+85) || (~((z <= -4.4e+54)) && (z <= 2.7e+20)))))
		tmp = x_m * (-z / y);
	else
		tmp = x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[z, -7.8e+176], N[Not[Or[LessEqual[z, -6e+85], And[N[Not[LessEqual[z, -4.4e+54]], $MachinePrecision], LessEqual[z, 2.7e+20]]]], $MachinePrecision]], N[(x$95$m * N[((-z) / y), $MachinePrecision]), $MachinePrecision], x$95$m]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+176} \lor \neg \left(z \leq -6 \cdot 10^{+85} \lor \neg \left(z \leq -4.4 \cdot 10^{+54}\right) \land z \leq 2.7 \cdot 10^{+20}\right):\\
\;\;\;\;x\_m \cdot \frac{-z}{y}\\

\mathbf{else}:\\
\;\;\;\;x\_m\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.8000000000000003e176 or -6.0000000000000001e85 < z < -4.3999999999999998e54 or 2.7e20 < z

    1. Initial program 95.0%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg95.0%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg295.0%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
      3. distribute-frac-neg95.0%

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in95.0%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*90.0%

        \[\leadsto \color{blue}{x \cdot \frac{-\left(y - z\right)}{-y}} \]
      6. distribute-frac-neg90.0%

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg290.0%

        \[\leadsto x \cdot \left(-\color{blue}{\left(-\frac{y - z}{y}\right)}\right) \]
      8. remove-double-neg90.0%

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub90.1%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses90.1%

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

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

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{z}{y}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg75.0%

        \[\leadsto x \cdot \color{blue}{\left(-\frac{z}{y}\right)} \]
      2. distribute-frac-neg275.0%

        \[\leadsto x \cdot \color{blue}{\frac{z}{-y}} \]
    7. Simplified75.0%

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

    if -7.8000000000000003e176 < z < -6.0000000000000001e85 or -4.3999999999999998e54 < z < 2.7e20

    1. Initial program 84.0%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg84.0%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg284.0%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
      3. distribute-frac-neg84.0%

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in84.0%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*99.9%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg299.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub99.9%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses99.9%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{z}{y}\right) \]
    3. Simplified99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+176} \lor \neg \left(z \leq -6 \cdot 10^{+85} \lor \neg \left(z \leq -4.4 \cdot 10^{+54}\right) \land z \leq 2.7 \cdot 10^{+20}\right):\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.0% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+16}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-39} \lor \neg \left(y \leq -4 \cdot 10^{-50}\right) \land y \leq 8.6 \cdot 10^{+37}:\\ \;\;\;\;z \cdot \frac{x\_m}{-y}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= y -3.2e+16)
    x_m
    (if (or (<= y -4.8e-39) (and (not (<= y -4e-50)) (<= y 8.6e+37)))
      (* z (/ x_m (- y)))
      x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (y <= -3.2e+16) {
		tmp = x_m;
	} else if ((y <= -4.8e-39) || (!(y <= -4e-50) && (y <= 8.6e+37))) {
		tmp = z * (x_m / -y);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-3.2d+16)) then
        tmp = x_m
    else if ((y <= (-4.8d-39)) .or. (.not. (y <= (-4d-50))) .and. (y <= 8.6d+37)) then
        tmp = z * (x_m / -y)
    else
        tmp = x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (y <= -3.2e+16) {
		tmp = x_m;
	} else if ((y <= -4.8e-39) || (!(y <= -4e-50) && (y <= 8.6e+37))) {
		tmp = z * (x_m / -y);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	tmp = 0
	if y <= -3.2e+16:
		tmp = x_m
	elif (y <= -4.8e-39) or (not (y <= -4e-50) and (y <= 8.6e+37)):
		tmp = z * (x_m / -y)
	else:
		tmp = x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (y <= -3.2e+16)
		tmp = x_m;
	elseif ((y <= -4.8e-39) || (!(y <= -4e-50) && (y <= 8.6e+37)))
		tmp = Float64(z * Float64(x_m / Float64(-y)));
	else
		tmp = x_m;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z)
	tmp = 0.0;
	if (y <= -3.2e+16)
		tmp = x_m;
	elseif ((y <= -4.8e-39) || (~((y <= -4e-50)) && (y <= 8.6e+37)))
		tmp = z * (x_m / -y);
	else
		tmp = x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[y, -3.2e+16], x$95$m, If[Or[LessEqual[y, -4.8e-39], And[N[Not[LessEqual[y, -4e-50]], $MachinePrecision], LessEqual[y, 8.6e+37]]], N[(z * N[(x$95$m / (-y)), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+16}:\\
\;\;\;\;x\_m\\

\mathbf{elif}\;y \leq -4.8 \cdot 10^{-39} \lor \neg \left(y \leq -4 \cdot 10^{-50}\right) \land y \leq 8.6 \cdot 10^{+37}:\\
\;\;\;\;z \cdot \frac{x\_m}{-y}\\

\mathbf{else}:\\
\;\;\;\;x\_m\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.2e16 or -4.80000000000000031e-39 < y < -4.00000000000000003e-50 or 8.5999999999999994e37 < y

    1. Initial program 80.1%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg80.1%

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

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
      3. distribute-frac-neg80.1%

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in80.1%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*99.9%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg299.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub99.9%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses99.9%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{z}{y}\right) \]
    3. Simplified99.9%

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

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

    if -3.2e16 < y < -4.80000000000000031e-39 or -4.00000000000000003e-50 < y < 8.5999999999999994e37

    1. Initial program 95.4%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg95.4%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg295.4%

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

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in95.4%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*92.9%

        \[\leadsto \color{blue}{x \cdot \frac{-\left(y - z\right)}{-y}} \]
      6. distribute-frac-neg92.9%

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg292.9%

        \[\leadsto x \cdot \left(-\color{blue}{\left(-\frac{y - z}{y}\right)}\right) \]
      8. remove-double-neg92.9%

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub92.9%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses92.9%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{z}{y}\right) \]
    3. Simplified92.9%

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{x}{y} \cdot z\right)} \]
      2. associate-*l*71.0%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{y}\right) \cdot z} \]
      3. *-commutative71.0%

        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{x}{y}\right)} \]
      4. associate-*r/71.0%

        \[\leadsto z \cdot \color{blue}{\frac{-1 \cdot x}{y}} \]
      5. mul-1-neg71.0%

        \[\leadsto z \cdot \frac{\color{blue}{-x}}{y} \]
    7. Simplified71.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-39} \lor \neg \left(y \leq -4 \cdot 10^{-50}\right) \land y \leq 8.6 \cdot 10^{+37}:\\ \;\;\;\;z \cdot \frac{x}{-y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.9% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_0 := \frac{x\_m \cdot z}{-y}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+176}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+87}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{+54}:\\ \;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+18}:\\ \;\;\;\;x\_m\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
 :precision binary64
 (let* ((t_0 (/ (* x_m z) (- y))))
   (*
    x_s
    (if (<= z -1.45e+176)
      t_0
      (if (<= z -1.85e+87)
        x_m
        (if (<= z -5.8e+54)
          (/ z (/ y (- x_m)))
          (if (<= z 8.5e+18) x_m t_0)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	double t_0 = (x_m * z) / -y;
	double tmp;
	if (z <= -1.45e+176) {
		tmp = t_0;
	} else if (z <= -1.85e+87) {
		tmp = x_m;
	} else if (z <= -5.8e+54) {
		tmp = z / (y / -x_m);
	} else if (z <= 8.5e+18) {
		tmp = x_m;
	} else {
		tmp = t_0;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x_m * z) / -y
    if (z <= (-1.45d+176)) then
        tmp = t_0
    else if (z <= (-1.85d+87)) then
        tmp = x_m
    else if (z <= (-5.8d+54)) then
        tmp = z / (y / -x_m)
    else if (z <= 8.5d+18) then
        tmp = x_m
    else
        tmp = t_0
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	double t_0 = (x_m * z) / -y;
	double tmp;
	if (z <= -1.45e+176) {
		tmp = t_0;
	} else if (z <= -1.85e+87) {
		tmp = x_m;
	} else if (z <= -5.8e+54) {
		tmp = z / (y / -x_m);
	} else if (z <= 8.5e+18) {
		tmp = x_m;
	} else {
		tmp = t_0;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	t_0 = (x_m * z) / -y
	tmp = 0
	if z <= -1.45e+176:
		tmp = t_0
	elif z <= -1.85e+87:
		tmp = x_m
	elif z <= -5.8e+54:
		tmp = z / (y / -x_m)
	elif z <= 8.5e+18:
		tmp = x_m
	else:
		tmp = t_0
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	t_0 = Float64(Float64(x_m * z) / Float64(-y))
	tmp = 0.0
	if (z <= -1.45e+176)
		tmp = t_0;
	elseif (z <= -1.85e+87)
		tmp = x_m;
	elseif (z <= -5.8e+54)
		tmp = Float64(z / Float64(y / Float64(-x_m)));
	elseif (z <= 8.5e+18)
		tmp = x_m;
	else
		tmp = t_0;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z)
	t_0 = (x_m * z) / -y;
	tmp = 0.0;
	if (z <= -1.45e+176)
		tmp = t_0;
	elseif (z <= -1.85e+87)
		tmp = x_m;
	elseif (z <= -5.8e+54)
		tmp = z / (y / -x_m);
	elseif (z <= 8.5e+18)
		tmp = x_m;
	else
		tmp = t_0;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := Block[{t$95$0 = N[(N[(x$95$m * z), $MachinePrecision] / (-y)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.45e+176], t$95$0, If[LessEqual[z, -1.85e+87], x$95$m, If[LessEqual[z, -5.8e+54], N[(z / N[(y / (-x$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+18], x$95$m, t$95$0]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_0 := \frac{x\_m \cdot z}{-y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+176}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{+87}:\\
\;\;\;\;x\_m\\

\mathbf{elif}\;z \leq -5.8 \cdot 10^{+54}:\\
\;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;x\_m\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.4500000000000001e176 or 8.5e18 < z

    1. Initial program 94.5%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot z\right)}}{y} \]
    4. Step-by-step derivation
      1. associate-*r*83.0%

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

        \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot z}{y} \]
    5. Simplified83.0%

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

    if -1.4500000000000001e176 < z < -1.85000000000000001e87 or -5.7999999999999997e54 < z < 8.5e18

    1. Initial program 84.0%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg84.0%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg284.0%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
      3. distribute-frac-neg84.0%

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in84.0%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*99.9%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg299.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub99.9%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses99.9%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{z}{y}\right) \]
    3. Simplified99.9%

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

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

    if -1.85000000000000001e87 < z < -5.7999999999999997e54

    1. Initial program 100.0%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot z\right)}}{y} \]
    4. Step-by-step derivation
      1. associate-*r*100.0%

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

        \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot z}{y} \]
    5. Simplified100.0%

      \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot z}}{y} \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{\color{blue}{z \cdot \left(-x\right)}}{y} \]
      2. associate-/l*99.6%

        \[\leadsto \color{blue}{z \cdot \frac{-x}{y}} \]
      3. add-sqr-sqrt25.0%

        \[\leadsto z \cdot \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{y} \]
      4. sqrt-unprod26.5%

        \[\leadsto z \cdot \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{y} \]
      5. sqr-neg26.5%

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

        \[\leadsto z \cdot \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{y} \]
      7. add-sqr-sqrt1.3%

        \[\leadsto z \cdot \frac{\color{blue}{x}}{y} \]
    7. Applied egg-rr1.3%

      \[\leadsto \color{blue}{z \cdot \frac{x}{y}} \]
    8. Step-by-step derivation
      1. *-commutative1.3%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot z} \]
      2. clear-num1.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \cdot z \]
      3. frac-2neg1.3%

        \[\leadsto \color{blue}{\frac{-1}{-\frac{y}{x}}} \cdot z \]
      4. metadata-eval1.3%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{-\frac{y}{x}}} \]
      6. neg-mul-11.3%

        \[\leadsto \frac{\color{blue}{-z}}{-\frac{y}{x}} \]
      7. distribute-frac-neg21.3%

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

        \[\leadsto \frac{-z}{\color{blue}{y \cdot \frac{1}{-x}}} \]
      9. add-sqr-sqrt0.2%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      10. sqrt-unprod51.4%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      11. sqr-neg51.4%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\sqrt{\color{blue}{x \cdot x}}}} \]
      12. sqrt-unprod74.6%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      13. add-sqr-sqrt99.8%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{x}}} \]
      14. *-un-lft-identity99.8%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{1 \cdot x}}} \]
      15. *-commutative99.8%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{x \cdot 1}}} \]
      16. *-inverses99.8%

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

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{\frac{x \cdot y}{y}}}} \]
      18. clear-num99.4%

        \[\leadsto \frac{-z}{y \cdot \color{blue}{\frac{y}{x \cdot y}}} \]
      19. *-commutative99.4%

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

        \[\leadsto \frac{-z}{y \cdot \color{blue}{\frac{\frac{y}{y}}{x}}} \]
      21. *-inverses99.8%

        \[\leadsto \frac{-z}{y \cdot \frac{\color{blue}{1}}{x}} \]
      22. div-inv100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+176}:\\ \;\;\;\;\frac{x \cdot z}{-y}\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+87}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{+54}:\\ \;\;\;\;\frac{z}{\frac{y}{-x}}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot z}{-y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.1% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+15}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-39}:\\ \;\;\;\;z \cdot \frac{x\_m}{-y}\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-50}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{+31}:\\ \;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= y -7.8e+15)
    x_m
    (if (<= y -6e-39)
      (* z (/ x_m (- y)))
      (if (<= y -3.9e-50) x_m (if (<= y 3.3e+31) (/ z (/ y (- x_m))) x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (y <= -7.8e+15) {
		tmp = x_m;
	} else if (y <= -6e-39) {
		tmp = z * (x_m / -y);
	} else if (y <= -3.9e-50) {
		tmp = x_m;
	} else if (y <= 3.3e+31) {
		tmp = z / (y / -x_m);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-7.8d+15)) then
        tmp = x_m
    else if (y <= (-6d-39)) then
        tmp = z * (x_m / -y)
    else if (y <= (-3.9d-50)) then
        tmp = x_m
    else if (y <= 3.3d+31) then
        tmp = z / (y / -x_m)
    else
        tmp = x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (y <= -7.8e+15) {
		tmp = x_m;
	} else if (y <= -6e-39) {
		tmp = z * (x_m / -y);
	} else if (y <= -3.9e-50) {
		tmp = x_m;
	} else if (y <= 3.3e+31) {
		tmp = z / (y / -x_m);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	tmp = 0
	if y <= -7.8e+15:
		tmp = x_m
	elif y <= -6e-39:
		tmp = z * (x_m / -y)
	elif y <= -3.9e-50:
		tmp = x_m
	elif y <= 3.3e+31:
		tmp = z / (y / -x_m)
	else:
		tmp = x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (y <= -7.8e+15)
		tmp = x_m;
	elseif (y <= -6e-39)
		tmp = Float64(z * Float64(x_m / Float64(-y)));
	elseif (y <= -3.9e-50)
		tmp = x_m;
	elseif (y <= 3.3e+31)
		tmp = Float64(z / Float64(y / Float64(-x_m)));
	else
		tmp = x_m;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z)
	tmp = 0.0;
	if (y <= -7.8e+15)
		tmp = x_m;
	elseif (y <= -6e-39)
		tmp = z * (x_m / -y);
	elseif (y <= -3.9e-50)
		tmp = x_m;
	elseif (y <= 3.3e+31)
		tmp = z / (y / -x_m);
	else
		tmp = x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[y, -7.8e+15], x$95$m, If[LessEqual[y, -6e-39], N[(z * N[(x$95$m / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.9e-50], x$95$m, If[LessEqual[y, 3.3e+31], N[(z / N[(y / (-x$95$m)), $MachinePrecision]), $MachinePrecision], x$95$m]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+15}:\\
\;\;\;\;x\_m\\

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

\mathbf{elif}\;y \leq -3.9 \cdot 10^{-50}:\\
\;\;\;\;x\_m\\

\mathbf{elif}\;y \leq 3.3 \cdot 10^{+31}:\\
\;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\

\mathbf{else}:\\
\;\;\;\;x\_m\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.8e15 or -6.00000000000000055e-39 < y < -3.90000000000000021e-50 or 3.29999999999999992e31 < y

    1. Initial program 80.2%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg80.2%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg280.2%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
      3. distribute-frac-neg80.2%

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in80.2%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*99.9%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg299.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub99.9%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses99.9%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{z}{y}\right) \]
    3. Simplified99.9%

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

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

    if -7.8e15 < y < -6.00000000000000055e-39

    1. Initial program 99.8%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg99.8%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg299.8%

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

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in99.8%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*99.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg299.7%

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

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub99.7%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses99.7%

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{x}{y} \cdot z\right)} \]
      2. associate-*l*79.0%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{y}\right) \cdot z} \]
      3. *-commutative79.0%

        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{x}{y}\right)} \]
      4. associate-*r/79.0%

        \[\leadsto z \cdot \color{blue}{\frac{-1 \cdot x}{y}} \]
      5. mul-1-neg79.0%

        \[\leadsto z \cdot \frac{\color{blue}{-x}}{y} \]
    7. Simplified79.0%

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

    if -3.90000000000000021e-50 < y < 3.29999999999999992e31

    1. Initial program 94.7%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot z\right)}}{y} \]
    4. Step-by-step derivation
      1. associate-*r*70.7%

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

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

      \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot z}}{y} \]
    6. Step-by-step derivation
      1. *-commutative70.7%

        \[\leadsto \frac{\color{blue}{z \cdot \left(-x\right)}}{y} \]
      2. associate-/l*70.0%

        \[\leadsto \color{blue}{z \cdot \frac{-x}{y}} \]
      3. add-sqr-sqrt28.8%

        \[\leadsto z \cdot \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{y} \]
      4. sqrt-unprod17.5%

        \[\leadsto z \cdot \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{y} \]
      5. sqr-neg17.5%

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

        \[\leadsto z \cdot \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{y} \]
      7. add-sqr-sqrt1.8%

        \[\leadsto z \cdot \frac{\color{blue}{x}}{y} \]
    7. Applied egg-rr1.8%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot z} \]
      2. clear-num1.8%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{-\frac{y}{x}}} \]
      6. neg-mul-11.8%

        \[\leadsto \frac{\color{blue}{-z}}{-\frac{y}{x}} \]
      7. distribute-frac-neg21.8%

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

        \[\leadsto \frac{-z}{\color{blue}{y \cdot \frac{1}{-x}}} \]
      9. add-sqr-sqrt0.9%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      10. sqrt-unprod31.3%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      11. sqr-neg31.3%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\sqrt{\color{blue}{x \cdot x}}}} \]
      12. sqrt-unprod41.5%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      13. add-sqr-sqrt71.0%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{x}}} \]
      14. *-un-lft-identity71.0%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{1 \cdot x}}} \]
      15. *-commutative71.0%

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{x \cdot 1}}} \]
      16. *-inverses71.0%

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

        \[\leadsto \frac{-z}{y \cdot \frac{1}{\color{blue}{\frac{x \cdot y}{y}}}} \]
      18. clear-num51.3%

        \[\leadsto \frac{-z}{y \cdot \color{blue}{\frac{y}{x \cdot y}}} \]
      19. *-commutative51.3%

        \[\leadsto \frac{-z}{y \cdot \frac{y}{\color{blue}{y \cdot x}}} \]
      20. associate-/r*71.0%

        \[\leadsto \frac{-z}{y \cdot \color{blue}{\frac{\frac{y}{y}}{x}}} \]
      21. *-inverses71.0%

        \[\leadsto \frac{-z}{y \cdot \frac{\color{blue}{1}}{x}} \]
      22. div-inv71.1%

        \[\leadsto \frac{-z}{\color{blue}{\frac{y}{x}}} \]
    9. Applied egg-rr71.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-39}:\\ \;\;\;\;z \cdot \frac{x}{-y}\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-50}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{+31}:\\ \;\;\;\;\frac{z}{\frac{y}{-x}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 49.5% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+14}:\\ \;\;\;\;y \cdot \frac{x\_m}{y}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z)
 :precision binary64
 (* x_s (if (<= z -1.65e+14) (* y (/ x_m y)) x_m)))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (z <= -1.65e+14) {
		tmp = y * (x_m / y);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-1.65d+14)) then
        tmp = y * (x_m / y)
    else
        tmp = x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (z <= -1.65e+14) {
		tmp = y * (x_m / y);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	tmp = 0
	if z <= -1.65e+14:
		tmp = y * (x_m / y)
	else:
		tmp = x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (z <= -1.65e+14)
		tmp = Float64(y * Float64(x_m / y));
	else
		tmp = x_m;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z)
	tmp = 0.0;
	if (z <= -1.65e+14)
		tmp = y * (x_m / y);
	else
		tmp = x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[z, -1.65e+14], N[(y * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision], x$95$m]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+14}:\\
\;\;\;\;y \cdot \frac{x\_m}{y}\\

\mathbf{else}:\\
\;\;\;\;x\_m\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.65e14

    1. Initial program 86.6%

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

      \[\leadsto \frac{\color{blue}{x \cdot y}}{y} \]
    4. Step-by-step derivation
      1. *-commutative17.9%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{y} \]
      2. associate-/l*38.4%

        \[\leadsto \color{blue}{y \cdot \frac{x}{y}} \]
    5. Applied egg-rr38.4%

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

    if -1.65e14 < z

    1. Initial program 88.6%

      \[\frac{x \cdot \left(y - z\right)}{y} \]
    2. Step-by-step derivation
      1. remove-double-neg88.6%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
      2. distribute-frac-neg288.6%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
      3. distribute-frac-neg88.6%

        \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
      4. distribute-rgt-neg-in88.6%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
      5. associate-/l*97.0%

        \[\leadsto \color{blue}{x \cdot \frac{-\left(y - z\right)}{-y}} \]
      6. distribute-frac-neg97.0%

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
      7. distribute-frac-neg297.0%

        \[\leadsto x \cdot \left(-\color{blue}{\left(-\frac{y - z}{y}\right)}\right) \]
      8. remove-double-neg97.0%

        \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
      9. div-sub97.0%

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
      10. *-inverses97.0%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{z}{y}\right) \]
    3. Simplified97.0%

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

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

Alternative 7: 96.3% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m - \frac{x\_m}{\frac{y}{z}}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z) :precision binary64 (* x_s (- x_m (/ x_m (/ y z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	return x_s * (x_m - (x_m / (y / z)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x_s * (x_m - (x_m / (y / z)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	return x_s * (x_m - (x_m / (y / z)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	return x_s * (x_m - (x_m / (y / z)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	return Float64(x_s * Float64(x_m - Float64(x_m / Float64(y / z))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z)
	tmp = x_s * (x_m - (x_m / (y / z)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * N[(x$95$m - N[(x$95$m / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \left(x\_m - \frac{x\_m}{\frac{y}{z}}\right)
\end{array}
Derivation
  1. Initial program 88.2%

    \[\frac{x \cdot \left(y - z\right)}{y} \]
  2. Step-by-step derivation
    1. remove-double-neg88.2%

      \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
    2. distribute-frac-neg288.2%

      \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
    3. distribute-frac-neg88.2%

      \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
    4. distribute-rgt-neg-in88.2%

      \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
    5. associate-/l*96.2%

      \[\leadsto \color{blue}{x \cdot \frac{-\left(y - z\right)}{-y}} \]
    6. distribute-frac-neg96.2%

      \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
    7. distribute-frac-neg296.2%

      \[\leadsto x \cdot \left(-\color{blue}{\left(-\frac{y - z}{y}\right)}\right) \]
    8. remove-double-neg96.2%

      \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
    9. div-sub96.2%

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
    10. *-inverses96.2%

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

    \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z}{y}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub-neg96.2%

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

      \[\leadsto \color{blue}{1 \cdot x + \left(-\frac{z}{y}\right) \cdot x} \]
    3. *-un-lft-identity96.2%

      \[\leadsto \color{blue}{x} + \left(-\frac{z}{y}\right) \cdot x \]
    4. distribute-neg-frac296.2%

      \[\leadsto x + \color{blue}{\frac{z}{-y}} \cdot x \]
  6. Applied egg-rr96.2%

    \[\leadsto \color{blue}{x + \frac{z}{-y} \cdot x} \]
  7. Taylor expanded in z around 0 94.3%

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

      \[\leadsto x + \color{blue}{\left(-\frac{x \cdot z}{y}\right)} \]
    2. associate-*l/92.2%

      \[\leadsto x + \left(-\color{blue}{\frac{x}{y} \cdot z}\right) \]
    3. associate-/r/96.3%

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

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

    \[\leadsto x + \color{blue}{\frac{x}{-\frac{y}{z}}} \]
  10. Final simplification96.3%

    \[\leadsto x - \frac{x}{\frac{y}{z}} \]
  11. Add Preprocessing

Alternative 8: 95.9% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m - x\_m \cdot \frac{z}{y}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z) :precision binary64 (* x_s (- x_m (* x_m (/ z y)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	return x_s * (x_m - (x_m * (z / y)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x_s * (x_m - (x_m * (z / y)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	return x_s * (x_m - (x_m * (z / y)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	return x_s * (x_m - (x_m * (z / y)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	return Float64(x_s * Float64(x_m - Float64(x_m * Float64(z / y))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z)
	tmp = x_s * (x_m - (x_m * (z / y)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * N[(x$95$m - N[(x$95$m * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \left(x\_m - x\_m \cdot \frac{z}{y}\right)
\end{array}
Derivation
  1. Initial program 88.2%

    \[\frac{x \cdot \left(y - z\right)}{y} \]
  2. Step-by-step derivation
    1. remove-double-neg88.2%

      \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
    2. distribute-frac-neg288.2%

      \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
    3. distribute-frac-neg88.2%

      \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
    4. distribute-rgt-neg-in88.2%

      \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
    5. associate-/l*96.2%

      \[\leadsto \color{blue}{x \cdot \frac{-\left(y - z\right)}{-y}} \]
    6. distribute-frac-neg96.2%

      \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
    7. distribute-frac-neg296.2%

      \[\leadsto x \cdot \left(-\color{blue}{\left(-\frac{y - z}{y}\right)}\right) \]
    8. remove-double-neg96.2%

      \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
    9. div-sub96.2%

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
    10. *-inverses96.2%

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

    \[\leadsto \color{blue}{x \cdot \left(1 - \frac{z}{y}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. sub-neg96.2%

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

      \[\leadsto \color{blue}{1 \cdot x + \left(-\frac{z}{y}\right) \cdot x} \]
    3. *-un-lft-identity96.2%

      \[\leadsto \color{blue}{x} + \left(-\frac{z}{y}\right) \cdot x \]
    4. distribute-neg-frac296.2%

      \[\leadsto x + \color{blue}{\frac{z}{-y}} \cdot x \]
  6. Applied egg-rr96.2%

    \[\leadsto \color{blue}{x + \frac{z}{-y} \cdot x} \]
  7. Taylor expanded in z around 0 94.3%

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

      \[\leadsto x + \color{blue}{\left(-\frac{x \cdot z}{y}\right)} \]
    2. associate-*l/92.2%

      \[\leadsto x + \left(-\color{blue}{\frac{x}{y} \cdot z}\right) \]
    3. associate-/r/96.3%

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{y}\right)} \]
  11. Step-by-step derivation
    1. mul-1-neg96.2%

      \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z}{y}\right)}\right) \]
    2. unsub-neg96.2%

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

      \[\leadsto \color{blue}{x \cdot 1 - x \cdot \frac{z}{y}} \]
    4. *-rgt-identity96.2%

      \[\leadsto \color{blue}{x} - x \cdot \frac{z}{y} \]
  12. Simplified96.2%

    \[\leadsto \color{blue}{x - x \cdot \frac{z}{y}} \]
  13. Add Preprocessing

Alternative 9: 95.9% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m \cdot \left(1 - \frac{z}{y}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z) :precision binary64 (* x_s (* x_m (- 1.0 (/ z y)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	return x_s * (x_m * (1.0 - (z / y)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x_s * (x_m * (1.0d0 - (z / y)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	return x_s * (x_m * (1.0 - (z / y)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	return x_s * (x_m * (1.0 - (z / y)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	return Float64(x_s * Float64(x_m * Float64(1.0 - Float64(z / y))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z)
	tmp = x_s * (x_m * (1.0 - (z / y)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * N[(x$95$m * N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \left(x\_m \cdot \left(1 - \frac{z}{y}\right)\right)
\end{array}
Derivation
  1. Initial program 88.2%

    \[\frac{x \cdot \left(y - z\right)}{y} \]
  2. Step-by-step derivation
    1. remove-double-neg88.2%

      \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
    2. distribute-frac-neg288.2%

      \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
    3. distribute-frac-neg88.2%

      \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
    4. distribute-rgt-neg-in88.2%

      \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
    5. associate-/l*96.2%

      \[\leadsto \color{blue}{x \cdot \frac{-\left(y - z\right)}{-y}} \]
    6. distribute-frac-neg96.2%

      \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
    7. distribute-frac-neg296.2%

      \[\leadsto x \cdot \left(-\color{blue}{\left(-\frac{y - z}{y}\right)}\right) \]
    8. remove-double-neg96.2%

      \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
    9. div-sub96.2%

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
    10. *-inverses96.2%

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

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

Alternative 10: 49.9% accurate, 7.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot x\_m \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z) :precision binary64 (* x_s x_m))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	return x_s * x_m;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x_s * x_m
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
	return x_s * x_m;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z):
	return x_s * x_m
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	return Float64(x_s * x_m)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z)
	tmp = x_s * x_m;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * x$95$m), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot x\_m
\end{array}
Derivation
  1. Initial program 88.2%

    \[\frac{x \cdot \left(y - z\right)}{y} \]
  2. Step-by-step derivation
    1. remove-double-neg88.2%

      \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-y\right)}} \]
    2. distribute-frac-neg288.2%

      \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{-y}} \]
    3. distribute-frac-neg88.2%

      \[\leadsto \color{blue}{\frac{-x \cdot \left(y - z\right)}{-y}} \]
    4. distribute-rgt-neg-in88.2%

      \[\leadsto \frac{\color{blue}{x \cdot \left(-\left(y - z\right)\right)}}{-y} \]
    5. associate-/l*96.2%

      \[\leadsto \color{blue}{x \cdot \frac{-\left(y - z\right)}{-y}} \]
    6. distribute-frac-neg96.2%

      \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{-y}\right)} \]
    7. distribute-frac-neg296.2%

      \[\leadsto x \cdot \left(-\color{blue}{\left(-\frac{y - z}{y}\right)}\right) \]
    8. remove-double-neg96.2%

      \[\leadsto x \cdot \color{blue}{\frac{y - z}{y}} \]
    9. div-sub96.2%

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{y} - \frac{z}{y}\right)} \]
    10. *-inverses96.2%

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer target: 95.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\ \;\;\;\;x - \frac{z \cdot x}{y}\\ \mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\ \;\;\;\;\frac{x}{\frac{y}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (< z -2.060202331921739e+104)
   (- x (/ (* z x) y))
   (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y)))))
double code(double x, double y, double z) {
	double tmp;
	if (z < -2.060202331921739e+104) {
		tmp = x - ((z * x) / y);
	} else if (z < 1.6939766013828526e+213) {
		tmp = x / (y / (y - z));
	} else {
		tmp = (y - 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) :: tmp
    if (z < (-2.060202331921739d+104)) then
        tmp = x - ((z * x) / y)
    else if (z < 1.6939766013828526d+213) then
        tmp = x / (y / (y - z))
    else
        tmp = (y - z) * (x / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z < -2.060202331921739e+104) {
		tmp = x - ((z * x) / y);
	} else if (z < 1.6939766013828526e+213) {
		tmp = x / (y / (y - z));
	} else {
		tmp = (y - z) * (x / y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z < -2.060202331921739e+104:
		tmp = x - ((z * x) / y)
	elif z < 1.6939766013828526e+213:
		tmp = x / (y / (y - z))
	else:
		tmp = (y - z) * (x / y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z < -2.060202331921739e+104)
		tmp = Float64(x - Float64(Float64(z * x) / y));
	elseif (z < 1.6939766013828526e+213)
		tmp = Float64(x / Float64(y / Float64(y - z)));
	else
		tmp = Float64(Float64(y - z) * Float64(x / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z < -2.060202331921739e+104)
		tmp = x - ((z * x) / y);
	elseif (z < 1.6939766013828526e+213)
		tmp = x / (y / (y - z));
	else
		tmp = (y - z) * (x / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Less[z, -2.060202331921739e+104], N[(x - N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[Less[z, 1.6939766013828526e+213], N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\
\;\;\;\;x - \frac{z \cdot x}{y}\\

\mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\

\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024100 
(FPCore (x y z)
  :name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
  :precision binary64

  :alt
  (if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))

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