fabs fraction 1

Percentage Accurate: 92.0% → 99.8%
Time: 13.2s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\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 14 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: 92.0% accurate, 1.0× speedup?

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

\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}

Alternative 1: 99.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \leq 2 \cdot 10^{-45}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{1}{y}, x + 4, 0 - \frac{x \cdot z}{y}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right|\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))) 2e-45)
   (fabs (fma (/ 1.0 y) (+ x 4.0) (- 0.0 (/ (* x z) y))))
   (fabs (+ (/ 4.0 y) (* (/ x y) (- 1.0 z))))))
double code(double x, double y, double z) {
	double tmp;
	if (fabs((((x + 4.0) / y) - ((x / y) * z))) <= 2e-45) {
		tmp = fabs(fma((1.0 / y), (x + 4.0), (0.0 - ((x * z) / y))));
	} else {
		tmp = fabs(((4.0 / y) + ((x / y) * (1.0 - z))));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) <= 2e-45)
		tmp = abs(fma(Float64(1.0 / y), Float64(x + 4.0), Float64(0.0 - Float64(Float64(x * z) / y))));
	else
		tmp = abs(Float64(Float64(4.0 / y) + Float64(Float64(x / y) * Float64(1.0 - z))));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2e-45], N[Abs[N[(N[(1.0 / y), $MachinePrecision] * N[(x + 4.0), $MachinePrecision] + N[(0.0 - N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(4.0 / y), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \leq 2 \cdot 10^{-45}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{1}{y}, x + 4, 0 - \frac{x \cdot z}{y}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 1.99999999999999997e-45

    1. Initial program 89.9%

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{\frac{y}{x + 4}} - \frac{x}{y} \cdot z\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{y} \cdot \left(x + 4\right) - \frac{x}{y} \cdot z\right)\right) \]
      3. fmm-defN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{fma}\left(\frac{1}{y}, x + 4, \mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
      4. fma-lowering-fma.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\left(\frac{1}{y}\right), \left(x + 4\right), \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, y\right), \left(x + 4\right), \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, y\right), \left(4 + x\right), \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, y\right), \mathsf{+.f64}\left(4, x\right), \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, y\right), \mathsf{+.f64}\left(4, x\right), \left(0 - \frac{x}{y} \cdot z\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, y\right), \mathsf{+.f64}\left(4, x\right), \mathsf{\_.f64}\left(0, \left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, y\right), \mathsf{+.f64}\left(4, x\right), \mathsf{\_.f64}\left(0, \left(\frac{x \cdot z}{y}\right)\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, y\right), \mathsf{+.f64}\left(4, x\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(x \cdot z\right), y\right)\right)\right)\right) \]
      12. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, y\right), \mathsf{+.f64}\left(4, x\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, z\right), y\right)\right)\right)\right) \]
    4. Applied egg-rr100.0%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\frac{1}{y}, 4 + x, 0 - \frac{x \cdot z}{y}\right)}\right| \]

    if 1.99999999999999997e-45 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)))

    1. Initial program 89.9%

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
    2. Step-by-step derivation
      1. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
      4. neg-sub0N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
      5. associate-+l-N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
      6. sub0-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
      7. neg-mul-1N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
      8. distribute-rgt-out--N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
      10. neg-mul-1N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
      11. associate-*l/N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
      13. neg-mul-1N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
      14. distribute-neg-inN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
      16. div-subN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
      17. distribute-neg-fracN/A

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

        \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
      19. +-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
      20. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
      21. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
      22. sub-negN/A

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
    3. Simplified99.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \leq 2 \cdot 10^{-45}:\\ \;\;\;\;\left|\mathsf{fma}\left(\frac{1}{y}, x + 4, 0 - \frac{x \cdot z}{y}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 59.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|\frac{z}{\frac{y}{x}}\right|\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{+240}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -850000:\\ \;\;\;\;\left|\frac{x}{y}\right|\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-108}:\\ \;\;\;\;\left|\frac{x \cdot z}{y}\right|\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-46}:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+22}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (fabs (/ z (/ y x)))))
   (if (<= x -3.4e+240)
     t_0
     (if (<= x -850000.0)
       (fabs (/ x y))
       (if (<= x -2.9e-108)
         (fabs (/ (* x z) y))
         (if (<= x 2e-46)
           (fabs (/ 4.0 y))
           (if (<= x 1.05e+22) t_0 (/ x y))))))))
double code(double x, double y, double z) {
	double t_0 = fabs((z / (y / x)));
	double tmp;
	if (x <= -3.4e+240) {
		tmp = t_0;
	} else if (x <= -850000.0) {
		tmp = fabs((x / y));
	} else if (x <= -2.9e-108) {
		tmp = fabs(((x * z) / y));
	} else if (x <= 2e-46) {
		tmp = fabs((4.0 / y));
	} else if (x <= 1.05e+22) {
		tmp = t_0;
	} else {
		tmp = 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) :: tmp
    t_0 = abs((z / (y / x)))
    if (x <= (-3.4d+240)) then
        tmp = t_0
    else if (x <= (-850000.0d0)) then
        tmp = abs((x / y))
    else if (x <= (-2.9d-108)) then
        tmp = abs(((x * z) / y))
    else if (x <= 2d-46) then
        tmp = abs((4.0d0 / y))
    else if (x <= 1.05d+22) then
        tmp = t_0
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.abs((z / (y / x)));
	double tmp;
	if (x <= -3.4e+240) {
		tmp = t_0;
	} else if (x <= -850000.0) {
		tmp = Math.abs((x / y));
	} else if (x <= -2.9e-108) {
		tmp = Math.abs(((x * z) / y));
	} else if (x <= 2e-46) {
		tmp = Math.abs((4.0 / y));
	} else if (x <= 1.05e+22) {
		tmp = t_0;
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.fabs((z / (y / x)))
	tmp = 0
	if x <= -3.4e+240:
		tmp = t_0
	elif x <= -850000.0:
		tmp = math.fabs((x / y))
	elif x <= -2.9e-108:
		tmp = math.fabs(((x * z) / y))
	elif x <= 2e-46:
		tmp = math.fabs((4.0 / y))
	elif x <= 1.05e+22:
		tmp = t_0
	else:
		tmp = x / y
	return tmp
function code(x, y, z)
	t_0 = abs(Float64(z / Float64(y / x)))
	tmp = 0.0
	if (x <= -3.4e+240)
		tmp = t_0;
	elseif (x <= -850000.0)
		tmp = abs(Float64(x / y));
	elseif (x <= -2.9e-108)
		tmp = abs(Float64(Float64(x * z) / y));
	elseif (x <= 2e-46)
		tmp = abs(Float64(4.0 / y));
	elseif (x <= 1.05e+22)
		tmp = t_0;
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = abs((z / (y / x)));
	tmp = 0.0;
	if (x <= -3.4e+240)
		tmp = t_0;
	elseif (x <= -850000.0)
		tmp = abs((x / y));
	elseif (x <= -2.9e-108)
		tmp = abs(((x * z) / y));
	elseif (x <= 2e-46)
		tmp = abs((4.0 / y));
	elseif (x <= 1.05e+22)
		tmp = t_0;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -3.4e+240], t$95$0, If[LessEqual[x, -850000.0], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -2.9e-108], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2e-46], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.05e+22], t$95$0, N[(x / y), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left|\frac{z}{\frac{y}{x}}\right|\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{+240}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq -850000:\\
\;\;\;\;\left|\frac{x}{y}\right|\\

\mathbf{elif}\;x \leq -2.9 \cdot 10^{-108}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\

\mathbf{elif}\;x \leq 2 \cdot 10^{-46}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{+22}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -3.40000000000000008e240 or 2.00000000000000005e-46 < x < 1.0499999999999999e22

    1. Initial program 86.1%

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

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right) \]
    5. Simplified79.6%

      \[\leadsto \left|\color{blue}{\frac{x}{y}} - \frac{x}{y} \cdot z\right| \]
    6. Step-by-step derivation
      1. fabs-subN/A

        \[\leadsto \left|\frac{x}{y} \cdot z - \frac{x}{y}\right| \]
      2. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x}{y} \cdot z - \frac{x}{y}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{x}{y} - \frac{x}{y}\right)\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{1}{\frac{y}{x}}\right)\right) \]
      7. sub-divN/A

        \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z - 1}{\frac{y}{x}}\right)\right) \]
      8. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, 1\right), \left(\frac{y}{x}\right)\right)\right) \]
      10. /-lowering-/.f6493.4%

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

      \[\leadsto \color{blue}{\left|\frac{z - 1}{\frac{y}{x}}\right|} \]
    8. Taylor expanded in z around inf

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

        \[\leadsto \left|\frac{\color{blue}{z}}{\frac{y}{x}}\right| \]

      if -3.40000000000000008e240 < x < -8.5e5

      1. Initial program 91.9%

        \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
      2. Step-by-step derivation
        1. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
        4. neg-sub0N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
        5. associate-+l-N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
        6. sub0-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
        7. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
        8. distribute-rgt-out--N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
        10. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
        11. associate-*l/N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
        13. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
        14. distribute-neg-inN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
        15. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
        16. div-subN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
        17. distribute-neg-fracN/A

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

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
        19. +-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        20. +-lowering-+.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        21. /-lowering-/.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        22. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
      3. Simplified99.9%

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

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
      6. Step-by-step derivation
        1. div-subN/A

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

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
        3. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
        5. --lowering--.f6491.2%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, z\right)\right), y\right)\right) \]
      7. Simplified91.2%

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

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}\right) \]
      9. Step-by-step derivation
        1. /-lowering-/.f6470.7%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, y\right)\right) \]
      10. Simplified70.7%

        \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]

      if -8.5e5 < x < -2.9000000000000001e-108

      1. Initial program 91.3%

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

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right) \]
      5. Simplified66.0%

        \[\leadsto \left|\color{blue}{\frac{x}{y}} - \frac{x}{y} \cdot z\right| \]
      6. Step-by-step derivation
        1. fabs-subN/A

          \[\leadsto \left|\frac{x}{y} \cdot z - \frac{x}{y}\right| \]
        2. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x}{y} \cdot z - \frac{x}{y}\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{x}{y} - \frac{x}{y}\right)\right) \]
        4. clear-numN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
        5. div-invN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
        6. clear-numN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{1}{\frac{y}{x}}\right)\right) \]
        7. sub-divN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z - 1}{\frac{y}{x}}\right)\right) \]
        8. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, 1\right), \left(\frac{y}{x}\right)\right)\right) \]
        10. /-lowering-/.f6465.9%

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

        \[\leadsto \color{blue}{\left|\frac{z - 1}{\frac{y}{x}}\right|} \]
      8. Taylor expanded in z around inf

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x \cdot z}{y}\right)}\right) \]
      9. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(x \cdot z\right), y\right)\right) \]
        2. *-lowering-*.f6473.6%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, z\right), y\right)\right) \]
      10. Simplified73.6%

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

      if -2.9000000000000001e-108 < x < 2.00000000000000005e-46

      1. Initial program 95.1%

        \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
      2. Step-by-step derivation
        1. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
        4. neg-sub0N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
        5. associate-+l-N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
        6. sub0-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
        7. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
        8. distribute-rgt-out--N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
        10. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
        11. associate-*l/N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
        13. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
        14. distribute-neg-inN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
        15. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
        16. div-subN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
        17. distribute-neg-fracN/A

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

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
        19. +-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        20. +-lowering-+.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        21. /-lowering-/.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        22. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
      3. Simplified95.1%

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

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{4}{y}\right)}\right) \]
      6. Step-by-step derivation
        1. /-lowering-/.f6484.0%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(4, y\right)\right) \]
      7. Simplified84.0%

        \[\leadsto \left|\color{blue}{\frac{4}{y}}\right| \]

      if 1.0499999999999999e22 < x

      1. Initial program 80.9%

        \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
      2. Step-by-step derivation
        1. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
        4. neg-sub0N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
        5. associate-+l-N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
        6. sub0-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
        7. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
        8. distribute-rgt-out--N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
        10. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
        11. associate-*l/N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
        13. neg-mul-1N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
        14. distribute-neg-inN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
        15. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
        16. div-subN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
        17. distribute-neg-fracN/A

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

          \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
        19. +-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        20. +-lowering-+.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        21. /-lowering-/.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
        22. sub-negN/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
      3. Simplified99.9%

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

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
      6. Step-by-step derivation
        1. div-subN/A

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

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
        3. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
        5. --lowering--.f6493.5%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, z\right)\right), y\right)\right) \]
      7. Simplified93.5%

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

        \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}\right) \]
      9. Step-by-step derivation
        1. /-lowering-/.f6476.4%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, y\right)\right) \]
      10. Simplified76.4%

        \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]
      11. Step-by-step derivation
        1. clear-numN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{\frac{y}{x}}\right)\right) \]
        2. associate-/r/N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{y} \cdot x\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{y}\right), x\right)\right) \]
        4. /-lowering-/.f6476.3%

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, y\right), x\right)\right) \]
      12. Applied egg-rr76.3%

        \[\leadsto \left|\color{blue}{\frac{1}{y} \cdot x}\right| \]
      13. Step-by-step derivation
        1. associate-/r/N/A

          \[\leadsto \left|\frac{1}{\frac{y}{x}}\right| \]
        2. inv-powN/A

          \[\leadsto \left|{\left(\frac{y}{x}\right)}^{-1}\right| \]
        3. sqr-powN/A

          \[\leadsto \left|{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}\right| \]
        4. fabs-sqrN/A

          \[\leadsto {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}} \]
        5. sqr-powN/A

          \[\leadsto {\left(\frac{y}{x}\right)}^{\color{blue}{-1}} \]
        6. inv-powN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{y}{x}}} \]
        7. clear-numN/A

          \[\leadsto \frac{x}{\color{blue}{y}} \]
        8. /-lowering-/.f6432.0%

          \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
      14. Applied egg-rr32.0%

        \[\leadsto \color{blue}{\frac{x}{y}} \]
    10. Recombined 5 regimes into one program.
    11. Add Preprocessing

    Alternative 3: 61.4% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|\frac{z}{\frac{y}{x}}\right|\\ \mathbf{if}\;x \leq -8.6 \cdot 10^{+236}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -900000:\\ \;\;\;\;\left|\frac{x}{y}\right|\\ \mathbf{elif}\;x \leq -2.85 \cdot 10^{-35}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8.6 \cdot 10^{-44}:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{+22}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (fabs (/ z (/ y x)))))
       (if (<= x -8.6e+236)
         t_0
         (if (<= x -900000.0)
           (fabs (/ x y))
           (if (<= x -2.85e-35)
             t_0
             (if (<= x 8.6e-44)
               (fabs (/ 4.0 y))
               (if (<= x 7.8e+22) t_0 (/ x y))))))))
    double code(double x, double y, double z) {
    	double t_0 = fabs((z / (y / x)));
    	double tmp;
    	if (x <= -8.6e+236) {
    		tmp = t_0;
    	} else if (x <= -900000.0) {
    		tmp = fabs((x / y));
    	} else if (x <= -2.85e-35) {
    		tmp = t_0;
    	} else if (x <= 8.6e-44) {
    		tmp = fabs((4.0 / y));
    	} else if (x <= 7.8e+22) {
    		tmp = t_0;
    	} else {
    		tmp = 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) :: tmp
        t_0 = abs((z / (y / x)))
        if (x <= (-8.6d+236)) then
            tmp = t_0
        else if (x <= (-900000.0d0)) then
            tmp = abs((x / y))
        else if (x <= (-2.85d-35)) then
            tmp = t_0
        else if (x <= 8.6d-44) then
            tmp = abs((4.0d0 / y))
        else if (x <= 7.8d+22) then
            tmp = t_0
        else
            tmp = x / y
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = Math.abs((z / (y / x)));
    	double tmp;
    	if (x <= -8.6e+236) {
    		tmp = t_0;
    	} else if (x <= -900000.0) {
    		tmp = Math.abs((x / y));
    	} else if (x <= -2.85e-35) {
    		tmp = t_0;
    	} else if (x <= 8.6e-44) {
    		tmp = Math.abs((4.0 / y));
    	} else if (x <= 7.8e+22) {
    		tmp = t_0;
    	} else {
    		tmp = x / y;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = math.fabs((z / (y / x)))
    	tmp = 0
    	if x <= -8.6e+236:
    		tmp = t_0
    	elif x <= -900000.0:
    		tmp = math.fabs((x / y))
    	elif x <= -2.85e-35:
    		tmp = t_0
    	elif x <= 8.6e-44:
    		tmp = math.fabs((4.0 / y))
    	elif x <= 7.8e+22:
    		tmp = t_0
    	else:
    		tmp = x / y
    	return tmp
    
    function code(x, y, z)
    	t_0 = abs(Float64(z / Float64(y / x)))
    	tmp = 0.0
    	if (x <= -8.6e+236)
    		tmp = t_0;
    	elseif (x <= -900000.0)
    		tmp = abs(Float64(x / y));
    	elseif (x <= -2.85e-35)
    		tmp = t_0;
    	elseif (x <= 8.6e-44)
    		tmp = abs(Float64(4.0 / y));
    	elseif (x <= 7.8e+22)
    		tmp = t_0;
    	else
    		tmp = Float64(x / y);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = abs((z / (y / x)));
    	tmp = 0.0;
    	if (x <= -8.6e+236)
    		tmp = t_0;
    	elseif (x <= -900000.0)
    		tmp = abs((x / y));
    	elseif (x <= -2.85e-35)
    		tmp = t_0;
    	elseif (x <= 8.6e-44)
    		tmp = abs((4.0 / y));
    	elseif (x <= 7.8e+22)
    		tmp = t_0;
    	else
    		tmp = x / y;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -8.6e+236], t$95$0, If[LessEqual[x, -900000.0], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -2.85e-35], t$95$0, If[LessEqual[x, 8.6e-44], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 7.8e+22], t$95$0, N[(x / y), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left|\frac{z}{\frac{y}{x}}\right|\\
    \mathbf{if}\;x \leq -8.6 \cdot 10^{+236}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq -900000:\\
    \;\;\;\;\left|\frac{x}{y}\right|\\
    
    \mathbf{elif}\;x \leq -2.85 \cdot 10^{-35}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 8.6 \cdot 10^{-44}:\\
    \;\;\;\;\left|\frac{4}{y}\right|\\
    
    \mathbf{elif}\;x \leq 7.8 \cdot 10^{+22}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x}{y}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if x < -8.5999999999999997e236 or -9e5 < x < -2.8500000000000001e-35 or 8.60000000000000027e-44 < x < 7.80000000000000042e22

      1. Initial program 89.9%

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

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right) \]
      5. Simplified82.9%

        \[\leadsto \left|\color{blue}{\frac{x}{y}} - \frac{x}{y} \cdot z\right| \]
      6. Step-by-step derivation
        1. fabs-subN/A

          \[\leadsto \left|\frac{x}{y} \cdot z - \frac{x}{y}\right| \]
        2. fabs-lowering-fabs.f64N/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x}{y} \cdot z - \frac{x}{y}\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{x}{y} - \frac{x}{y}\right)\right) \]
        4. clear-numN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
        5. div-invN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
        6. clear-numN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{1}{\frac{y}{x}}\right)\right) \]
        7. sub-divN/A

          \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z - 1}{\frac{y}{x}}\right)\right) \]
        8. /-lowering-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\left|\frac{z - 1}{\frac{y}{x}}\right|} \]
      8. Taylor expanded in z around inf

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

          \[\leadsto \left|\frac{\color{blue}{z}}{\frac{y}{x}}\right| \]

        if -8.5999999999999997e236 < x < -9e5

        1. Initial program 91.9%

          \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
        2. Step-by-step derivation
          1. fabs-lowering-fabs.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
          4. neg-sub0N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
          5. associate-+l-N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
          6. sub0-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
          7. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
          8. distribute-rgt-out--N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
          9. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
          10. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
          11. associate-*l/N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
          12. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
          13. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
          14. distribute-neg-inN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
          15. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
          17. distribute-neg-fracN/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
          19. +-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          20. +-lowering-+.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          21. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          22. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
        3. Simplified99.9%

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

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
        6. Step-by-step derivation
          1. div-subN/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
          3. /-lowering-/.f64N/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
          5. --lowering--.f6491.2%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, z\right)\right), y\right)\right) \]
        7. Simplified91.2%

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

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}\right) \]
        9. Step-by-step derivation
          1. /-lowering-/.f6470.7%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, y\right)\right) \]
        10. Simplified70.7%

          \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]

        if -2.8500000000000001e-35 < x < 8.60000000000000027e-44

        1. Initial program 93.9%

          \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
        2. Step-by-step derivation
          1. fabs-lowering-fabs.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
          4. neg-sub0N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
          5. associate-+l-N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
          6. sub0-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
          7. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
          8. distribute-rgt-out--N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
          9. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
          10. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
          11. associate-*l/N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
          12. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
          13. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
          14. distribute-neg-inN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
          15. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
          17. distribute-neg-fracN/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
          19. +-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          20. +-lowering-+.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          21. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          22. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
        3. Simplified93.9%

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

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{4}{y}\right)}\right) \]
        6. Step-by-step derivation
          1. /-lowering-/.f6480.4%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(4, y\right)\right) \]
        7. Simplified80.4%

          \[\leadsto \left|\color{blue}{\frac{4}{y}}\right| \]

        if 7.80000000000000042e22 < x

        1. Initial program 80.9%

          \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
        2. Step-by-step derivation
          1. fabs-lowering-fabs.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
          4. neg-sub0N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
          5. associate-+l-N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
          6. sub0-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
          7. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
          8. distribute-rgt-out--N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
          9. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
          10. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
          11. associate-*l/N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
          12. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
          13. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
          14. distribute-neg-inN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
          15. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
          17. distribute-neg-fracN/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
          19. +-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          20. +-lowering-+.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          21. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          22. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
        3. Simplified99.9%

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

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
        6. Step-by-step derivation
          1. div-subN/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
          3. /-lowering-/.f64N/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
          5. --lowering--.f6493.5%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, z\right)\right), y\right)\right) \]
        7. Simplified93.5%

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

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}\right) \]
        9. Step-by-step derivation
          1. /-lowering-/.f6476.4%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, y\right)\right) \]
        10. Simplified76.4%

          \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]
        11. Step-by-step derivation
          1. clear-numN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{\frac{y}{x}}\right)\right) \]
          2. associate-/r/N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{y} \cdot x\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{y}\right), x\right)\right) \]
          4. /-lowering-/.f6476.3%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, y\right), x\right)\right) \]
        12. Applied egg-rr76.3%

          \[\leadsto \left|\color{blue}{\frac{1}{y} \cdot x}\right| \]
        13. Step-by-step derivation
          1. associate-/r/N/A

            \[\leadsto \left|\frac{1}{\frac{y}{x}}\right| \]
          2. inv-powN/A

            \[\leadsto \left|{\left(\frac{y}{x}\right)}^{-1}\right| \]
          3. sqr-powN/A

            \[\leadsto \left|{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}\right| \]
          4. fabs-sqrN/A

            \[\leadsto {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}} \]
          5. sqr-powN/A

            \[\leadsto {\left(\frac{y}{x}\right)}^{\color{blue}{-1}} \]
          6. inv-powN/A

            \[\leadsto \frac{1}{\color{blue}{\frac{y}{x}}} \]
          7. clear-numN/A

            \[\leadsto \frac{x}{\color{blue}{y}} \]
          8. /-lowering-/.f6432.0%

            \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
        14. Applied egg-rr32.0%

          \[\leadsto \color{blue}{\frac{x}{y}} \]
      10. Recombined 4 regimes into one program.
      11. Add Preprocessing

      Alternative 4: 98.8% accurate, 0.9× speedup?

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

        1. Initial program 85.6%

          \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
        2. Step-by-step derivation
          1. fabs-lowering-fabs.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
          4. neg-sub0N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
          5. associate-+l-N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
          6. sub0-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
          7. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
          8. distribute-rgt-out--N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
          9. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
          10. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
          11. associate-*l/N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
          12. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
          13. neg-mul-1N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
          14. distribute-neg-inN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
          15. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
          16. div-subN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
          17. distribute-neg-fracN/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
          19. +-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          20. +-lowering-+.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          21. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
          22. sub-negN/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
        3. Simplified99.9%

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

          \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
        6. Step-by-step derivation
          1. div-subN/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
          3. /-lowering-/.f64N/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
          5. --lowering--.f6492.4%

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

          \[\leadsto \left|\color{blue}{\frac{x \cdot \left(1 - z\right)}{y}}\right| \]
        8. Step-by-step derivation
          1. *-commutativeN/A

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

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

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, z\right), \left(\frac{x}{y}\right)\right)\right) \]
          5. /-lowering-/.f6498.0%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, z\right), \mathsf{/.f64}\left(x, y\right)\right)\right) \]
        9. Applied egg-rr98.0%

          \[\leadsto \left|\color{blue}{\left(1 - z\right) \cdot \frac{x}{y}}\right| \]
        10. Step-by-step derivation
          1. associate-*r/N/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1 - z}{y} \cdot x\right)\right) \]
          3. clear-numN/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1 \cdot x}{\frac{y}{1 - z}}\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\frac{1}{1} \cdot x}{\frac{y}{1 - z}}\right)\right) \]
          6. associate-/r/N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\frac{1}{\frac{1}{x}}}{\frac{y}{1 - z}}\right)\right) \]
          7. remove-double-divN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x}{\frac{y}{1 - z}}\right)\right) \]
          8. /-lowering-/.f64N/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \left(1 - z\right)\right)\right)\right) \]
          10. --lowering--.f6498.0%

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(1, z\right)\right)\right)\right) \]
        11. Applied egg-rr98.0%

          \[\leadsto \left|\color{blue}{\frac{x}{\frac{y}{1 - z}}}\right| \]

        if -180 < x < 4

        1. Initial program 94.6%

          \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. fabs-lowering-fabs.f64N/A

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

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x \cdot z}{y}\right)\right) \]
          3. sub-divN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\left(x + 4\right) - x \cdot z}{y}\right)\right) \]
          4. flip3-+N/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\frac{{x}^{3} + {4}^{3}}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)} - x \cdot z}{y}\right)\right) \]
          5. div-invN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\left({x}^{3} + {4}^{3}\right) \cdot \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)} - x \cdot z}{y}\right)\right) \]
          6. fmm-defN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(x \cdot z\right)\right)}{y}\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(z \cdot x\right)\right)}{y}\right)\right) \]
          8. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(z \cdot x\right)\right)\right), y\right)\right) \]
        4. Applied egg-rr99.9%

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

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

            \[\leadsto \left|\frac{\color{blue}{4} - x \cdot z}{y}\right| \]
        7. Recombined 2 regimes into one program.
        8. Add Preprocessing

        Alternative 5: 85.3% accurate, 0.9× speedup?

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

          1. Initial program 86.7%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified98.7%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
          6. Step-by-step derivation
            1. div-subN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
            3. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
            5. --lowering--.f6489.5%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, z\right)\right), y\right)\right) \]
          7. Simplified89.5%

            \[\leadsto \left|\color{blue}{\frac{x \cdot \left(1 - z\right)}{y}}\right| \]
          8. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, z\right), \left(\frac{x}{y}\right)\right)\right) \]
            5. /-lowering-/.f6493.0%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, z\right), \mathsf{/.f64}\left(x, y\right)\right)\right) \]
          9. Applied egg-rr93.0%

            \[\leadsto \left|\color{blue}{\left(1 - z\right) \cdot \frac{x}{y}}\right| \]
          10. Step-by-step derivation
            1. associate-*r/N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1 - z}{y} \cdot x\right)\right) \]
            3. clear-numN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1 \cdot x}{\frac{y}{1 - z}}\right)\right) \]
            5. metadata-evalN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\frac{1}{1} \cdot x}{\frac{y}{1 - z}}\right)\right) \]
            6. associate-/r/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\frac{1}{\frac{1}{x}}}{\frac{y}{1 - z}}\right)\right) \]
            7. remove-double-divN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x}{\frac{y}{1 - z}}\right)\right) \]
            8. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \left(1 - z\right)\right)\right)\right) \]
            10. --lowering--.f6494.2%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(1, z\right)\right)\right)\right) \]
          11. Applied egg-rr94.2%

            \[\leadsto \left|\color{blue}{\frac{x}{\frac{y}{1 - z}}}\right| \]

          if -3.40000000000000002e-108 < x < 2.20000000000000012e-44

          1. Initial program 95.1%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified95.1%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{4}{y}\right)}\right) \]
          6. Step-by-step derivation
            1. /-lowering-/.f6484.0%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(4, y\right)\right) \]
          7. Simplified84.0%

            \[\leadsto \left|\color{blue}{\frac{4}{y}}\right| \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 6: 85.2% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-108}:\\ \;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-44}:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= x -3.4e-108)
           (fabs (* x (/ (- 1.0 z) y)))
           (if (<= x 3.1e-44) (fabs (/ 4.0 y)) (fabs (* (/ x y) (- 1.0 z))))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (x <= -3.4e-108) {
        		tmp = fabs((x * ((1.0 - z) / y)));
        	} else if (x <= 3.1e-44) {
        		tmp = fabs((4.0 / y));
        	} else {
        		tmp = fabs(((x / y) * (1.0 - z)));
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8) :: tmp
            if (x <= (-3.4d-108)) then
                tmp = abs((x * ((1.0d0 - z) / y)))
            else if (x <= 3.1d-44) then
                tmp = abs((4.0d0 / y))
            else
                tmp = abs(((x / y) * (1.0d0 - z)))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z) {
        	double tmp;
        	if (x <= -3.4e-108) {
        		tmp = Math.abs((x * ((1.0 - z) / y)));
        	} else if (x <= 3.1e-44) {
        		tmp = Math.abs((4.0 / y));
        	} else {
        		tmp = Math.abs(((x / y) * (1.0 - z)));
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	tmp = 0
        	if x <= -3.4e-108:
        		tmp = math.fabs((x * ((1.0 - z) / y)))
        	elif x <= 3.1e-44:
        		tmp = math.fabs((4.0 / y))
        	else:
        		tmp = math.fabs(((x / y) * (1.0 - z)))
        	return tmp
        
        function code(x, y, z)
        	tmp = 0.0
        	if (x <= -3.4e-108)
        		tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y)));
        	elseif (x <= 3.1e-44)
        		tmp = abs(Float64(4.0 / y));
        	else
        		tmp = abs(Float64(Float64(x / y) * Float64(1.0 - z)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z)
        	tmp = 0.0;
        	if (x <= -3.4e-108)
        		tmp = abs((x * ((1.0 - z) / y)));
        	elseif (x <= 3.1e-44)
        		tmp = abs((4.0 / y));
        	else
        		tmp = abs(((x / y) * (1.0 - z)));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := If[LessEqual[x, -3.4e-108], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 3.1e-44], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x \leq -3.4 \cdot 10^{-108}:\\
        \;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\
        
        \mathbf{elif}\;x \leq 3.1 \cdot 10^{-44}:\\
        \;\;\;\;\left|\frac{4}{y}\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if x < -3.40000000000000002e-108

          1. Initial program 88.9%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified97.8%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
          6. Step-by-step derivation
            1. div-subN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
            3. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
            5. --lowering--.f6487.8%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, z\right)\right), y\right)\right) \]
          7. Simplified87.8%

            \[\leadsto \left|\color{blue}{\frac{x \cdot \left(1 - z\right)}{y}}\right| \]
          8. Step-by-step derivation
            1. associate-/l*N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(x \cdot \frac{1 - z}{y}\right)\right) \]
            2. *-commutativeN/A

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(1 - z\right), y\right), x\right)\right) \]
            5. --lowering--.f6491.8%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, z\right), y\right), x\right)\right) \]
          9. Applied egg-rr91.8%

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

          if -3.40000000000000002e-108 < x < 3.09999999999999984e-44

          1. Initial program 95.1%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified95.1%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{4}{y}\right)}\right) \]
          6. Step-by-step derivation
            1. /-lowering-/.f6484.0%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(4, y\right)\right) \]
          7. Simplified84.0%

            \[\leadsto \left|\color{blue}{\frac{4}{y}}\right| \]

          if 3.09999999999999984e-44 < x

          1. Initial program 83.9%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified99.8%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
          6. Step-by-step derivation
            1. div-subN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
            3. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
            5. --lowering--.f6491.7%

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

            \[\leadsto \left|\color{blue}{\frac{x \cdot \left(1 - z\right)}{y}}\right| \]
          8. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-108}:\\ \;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{-44}:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\ \end{array} \]
        5. Add Preprocessing

        Alternative 7: 86.8% accurate, 0.9× speedup?

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

          1. Initial program 87.0%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified99.9%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
          6. Step-by-step derivation
            1. div-subN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
            3. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
            5. --lowering--.f6491.9%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, z\right)\right), y\right)\right) \]
          7. Simplified91.9%

            \[\leadsto \left|\color{blue}{\frac{x \cdot \left(1 - z\right)}{y}}\right| \]
          8. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, z\right), \left(\frac{x}{y}\right)\right)\right) \]
            5. /-lowering-/.f6497.0%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, z\right), \mathsf{/.f64}\left(x, y\right)\right)\right) \]
          9. Applied egg-rr97.0%

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

          if -1.9000000000000002e-37 < x < 1.5499999999999999e-47

          1. Initial program 93.9%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified93.9%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{4}{y}\right)}\right) \]
          6. Step-by-step derivation
            1. /-lowering-/.f6480.4%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(4, y\right)\right) \]
          7. Simplified80.4%

            \[\leadsto \left|\color{blue}{\frac{4}{y}}\right| \]
        3. Recombined 2 regimes into one program.
        4. Final simplification90.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-37}:\\ \;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-47}:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\ \end{array} \]
        5. Add Preprocessing

        Alternative 8: 97.8% accurate, 1.0× speedup?

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

          1. Initial program 89.7%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x \cdot z}{y}\right)\right) \]
            3. sub-divN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\left(x + 4\right) - x \cdot z}{y}\right)\right) \]
            4. flip3-+N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\frac{{x}^{3} + {4}^{3}}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)} - x \cdot z}{y}\right)\right) \]
            5. div-invN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\left({x}^{3} + {4}^{3}\right) \cdot \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)} - x \cdot z}{y}\right)\right) \]
            6. fmm-defN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(x \cdot z\right)\right)}{y}\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(z \cdot x\right)\right)}{y}\right)\right) \]
            8. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(z \cdot x\right)\right)\right), y\right)\right) \]
          4. Applied egg-rr98.3%

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

          if 4.00000000000000006e100 < y

          1. Initial program 91.5%

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right), \left(\frac{x \cdot z}{y}\right)\right)\right) \]
            2. associate-/l*N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right), \left(x \cdot \frac{z}{y}\right)\right)\right) \]
            3. *-lowering-*.f64N/A

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

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

            \[\leadsto \left|\frac{x + 4}{y} - \color{blue}{x \cdot \frac{z}{y}}\right| \]
        3. Recombined 2 regimes into one program.
        4. Final simplification98.5%

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

        Alternative 9: 85.0% accurate, 1.0× speedup?

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

          1. Initial program 94.2%

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

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

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

            \[\leadsto \left|\color{blue}{\frac{x}{y}} - \frac{x}{y} \cdot z\right| \]
          6. Step-by-step derivation
            1. fabs-subN/A

              \[\leadsto \left|\frac{x}{y} \cdot z - \frac{x}{y}\right| \]
            2. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x}{y} \cdot z - \frac{x}{y}\right)\right) \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{x}{y} - \frac{x}{y}\right)\right) \]
            4. clear-numN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
            5. div-invN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
            6. clear-numN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{1}{\frac{y}{x}}\right)\right) \]
            7. sub-divN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z - 1}{\frac{y}{x}}\right)\right) \]
            8. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, 1\right), \left(\frac{y}{x}\right)\right)\right) \]
            10. /-lowering-/.f6473.5%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, 1\right), \mathsf{/.f64}\left(y, x\right)\right)\right) \]
          7. Applied egg-rr73.5%

            \[\leadsto \color{blue}{\left|\frac{z - 1}{\frac{y}{x}}\right|} \]
          8. Taylor expanded in z around inf

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

              \[\leadsto \left|\frac{\color{blue}{z}}{\frac{y}{x}}\right| \]

            if -2.70000000000000011e54 < z < 1.25e19

            1. Initial program 94.3%

              \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
            2. Step-by-step derivation
              1. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
              2. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
              4. neg-sub0N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
              5. associate-+l-N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              6. sub0-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
              7. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              8. distribute-rgt-out--N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              10. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              11. associate-*l/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
              12. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
              13. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
              14. distribute-neg-inN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
              15. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
              16. div-subN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
              17. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
              19. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              20. +-lowering-+.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              21. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              22. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
            3. Simplified100.0%

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(4 \cdot \frac{1}{y} + \frac{x}{y}\right)}\right) \]
            6. Step-by-step derivation
              1. *-rgt-identityN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(4 \cdot \frac{1}{y} + \frac{x \cdot 1}{y}\right)\right) \]
              2. associate-*r/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(4 \cdot \frac{1}{y} + x \cdot \frac{1}{y}\right)\right) \]
              3. distribute-rgt-outN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1 \cdot \left(4 + x\right)}{y}\right)\right) \]
              5. metadata-evalN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(4 + x\right)}{y}\right)\right) \]
              6. distribute-lft-neg-inN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\mathsf{neg}\left(-1 \cdot \left(4 + x\right)\right)}{y}\right)\right) \]
              7. distribute-frac-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\frac{-1 \cdot \left(4 + x\right)}{y}\right)\right)\right) \]
              8. mul-1-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(4 + x\right)\right)}{y}\right)\right)\right) \]
              9. distribute-frac-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{4 + x}{y}\right)\right)\right)\right)\right) \]
              10. remove-double-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4 + x}{y}\right)\right) \]
              11. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(4 + x\right), y\right)\right) \]
              12. +-lowering-+.f6497.8%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(4, x\right), y\right)\right) \]
            7. Simplified97.8%

              \[\leadsto \left|\color{blue}{\frac{4 + x}{y}}\right| \]

            if 1.25e19 < z

            1. Initial program 71.5%

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

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

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right) \]
            5. Simplified58.4%

              \[\leadsto \left|\color{blue}{\frac{x}{y}} - \frac{x}{y} \cdot z\right| \]
            6. Step-by-step derivation
              1. fabs-subN/A

                \[\leadsto \left|\frac{x}{y} \cdot z - \frac{x}{y}\right| \]
              2. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x}{y} \cdot z - \frac{x}{y}\right)\right) \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{x}{y} - \frac{x}{y}\right)\right) \]
              4. clear-numN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
              5. div-invN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{x}{y}\right)\right) \]
              6. clear-numN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z}{\frac{y}{x}} - \frac{1}{\frac{y}{x}}\right)\right) \]
              7. sub-divN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{z - 1}{\frac{y}{x}}\right)\right) \]
              8. /-lowering-/.f64N/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, 1\right), \left(\frac{y}{x}\right)\right)\right) \]
              10. /-lowering-/.f6481.0%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(z, 1\right), \mathsf{/.f64}\left(y, x\right)\right)\right) \]
            7. Applied egg-rr81.0%

              \[\leadsto \color{blue}{\left|\frac{z - 1}{\frac{y}{x}}\right|} \]
            8. Taylor expanded in z around inf

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x \cdot z}{y}\right)}\right) \]
            9. Step-by-step derivation
              1. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(x \cdot z\right), y\right)\right) \]
              2. *-lowering-*.f6481.1%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, z\right), y\right)\right) \]
            10. Simplified81.1%

              \[\leadsto \left|\color{blue}{\frac{x \cdot z}{y}}\right| \]
          10. Recombined 3 regimes into one program.
          11. Final simplification88.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+54}:\\ \;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+19}:\\ \;\;\;\;\left|\frac{x + 4}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x \cdot z}{y}\right|\\ \end{array} \]
          12. Add Preprocessing

          Alternative 10: 60.5% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.5:\\ \;\;\;\;\left|\frac{x}{y}\right|\\ \mathbf{elif}\;x \leq 4:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= x -1.5) (fabs (/ x y)) (if (<= x 4.0) (fabs (/ 4.0 y)) (/ x y))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (x <= -1.5) {
          		tmp = fabs((x / y));
          	} else if (x <= 4.0) {
          		tmp = fabs((4.0 / y));
          	} else {
          		tmp = 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 (x <= (-1.5d0)) then
                  tmp = abs((x / y))
              else if (x <= 4.0d0) then
                  tmp = abs((4.0d0 / y))
              else
                  tmp = x / y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double tmp;
          	if (x <= -1.5) {
          		tmp = Math.abs((x / y));
          	} else if (x <= 4.0) {
          		tmp = Math.abs((4.0 / y));
          	} else {
          		tmp = x / y;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	tmp = 0
          	if x <= -1.5:
          		tmp = math.fabs((x / y))
          	elif x <= 4.0:
          		tmp = math.fabs((4.0 / y))
          	else:
          		tmp = x / y
          	return tmp
          
          function code(x, y, z)
          	tmp = 0.0
          	if (x <= -1.5)
          		tmp = abs(Float64(x / y));
          	elseif (x <= 4.0)
          		tmp = abs(Float64(4.0 / y));
          	else
          		tmp = Float64(x / y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	tmp = 0.0;
          	if (x <= -1.5)
          		tmp = abs((x / y));
          	elseif (x <= 4.0)
          		tmp = abs((4.0 / y));
          	else
          		tmp = x / y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := If[LessEqual[x, -1.5], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.0], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], N[(x / y), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -1.5:\\
          \;\;\;\;\left|\frac{x}{y}\right|\\
          
          \mathbf{elif}\;x \leq 4:\\
          \;\;\;\;\left|\frac{4}{y}\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if x < -1.5

            1. Initial program 88.3%

              \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
            2. Step-by-step derivation
              1. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
              2. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
              4. neg-sub0N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
              5. associate-+l-N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              6. sub0-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
              7. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              8. distribute-rgt-out--N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              10. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              11. associate-*l/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
              12. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
              13. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
              14. distribute-neg-inN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
              15. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
              16. div-subN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
              17. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
              19. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              20. +-lowering-+.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              21. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              22. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
            3. Simplified99.9%

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
            6. Step-by-step derivation
              1. div-subN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
              3. /-lowering-/.f64N/A

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

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}\right) \]
            9. Step-by-step derivation
              1. /-lowering-/.f6466.8%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, y\right)\right) \]
            10. Simplified66.8%

              \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]

            if -1.5 < x < 4

            1. Initial program 94.5%

              \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
            2. Step-by-step derivation
              1. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
              2. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
              4. neg-sub0N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
              5. associate-+l-N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              6. sub0-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
              7. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              8. distribute-rgt-out--N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              10. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              11. associate-*l/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
              12. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
              13. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
              14. distribute-neg-inN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
              15. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
              16. div-subN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
              17. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
              19. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              20. +-lowering-+.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              21. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              22. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
            3. Simplified94.5%

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{4}{y}\right)}\right) \]
            6. Step-by-step derivation
              1. /-lowering-/.f6472.8%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(4, y\right)\right) \]
            7. Simplified72.8%

              \[\leadsto \left|\color{blue}{\frac{4}{y}}\right| \]

            if 4 < x

            1. Initial program 83.0%

              \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
            2. Step-by-step derivation
              1. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
              2. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
              4. neg-sub0N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
              5. associate-+l-N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              6. sub0-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
              7. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              8. distribute-rgt-out--N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              10. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              11. associate-*l/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
              12. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
              13. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
              14. distribute-neg-inN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
              15. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
              16. div-subN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
              17. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
              19. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              20. +-lowering-+.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              21. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              22. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
            3. Simplified99.9%

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
            6. Step-by-step derivation
              1. div-subN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
              3. /-lowering-/.f64N/A

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

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}\right) \]
            9. Step-by-step derivation
              1. /-lowering-/.f6470.2%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, y\right)\right) \]
            10. Simplified70.2%

              \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]
            11. Step-by-step derivation
              1. clear-numN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{\frac{y}{x}}\right)\right) \]
              2. associate-/r/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{y} \cdot x\right)\right) \]
              3. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{y}\right), x\right)\right) \]
              4. /-lowering-/.f6470.1%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, y\right), x\right)\right) \]
            12. Applied egg-rr70.1%

              \[\leadsto \left|\color{blue}{\frac{1}{y} \cdot x}\right| \]
            13. Step-by-step derivation
              1. associate-/r/N/A

                \[\leadsto \left|\frac{1}{\frac{y}{x}}\right| \]
              2. inv-powN/A

                \[\leadsto \left|{\left(\frac{y}{x}\right)}^{-1}\right| \]
              3. sqr-powN/A

                \[\leadsto \left|{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}\right| \]
              4. fabs-sqrN/A

                \[\leadsto {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}} \]
              5. sqr-powN/A

                \[\leadsto {\left(\frac{y}{x}\right)}^{\color{blue}{-1}} \]
              6. inv-powN/A

                \[\leadsto \frac{1}{\color{blue}{\frac{y}{x}}} \]
              7. clear-numN/A

                \[\leadsto \frac{x}{\color{blue}{y}} \]
              8. /-lowering-/.f6430.0%

                \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
            14. Applied egg-rr30.0%

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

          Alternative 11: 98.0% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right| \end{array} \]
          (FPCore (x y z) :precision binary64 (fabs (+ (/ 4.0 y) (* (/ x y) (- 1.0 z)))))
          double code(double x, double y, double z) {
          	return fabs(((4.0 / y) + ((x / y) * (1.0 - z))));
          }
          
          real(8) function code(x, y, z)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              code = abs(((4.0d0 / y) + ((x / y) * (1.0d0 - z))))
          end function
          
          public static double code(double x, double y, double z) {
          	return Math.abs(((4.0 / y) + ((x / y) * (1.0 - z))));
          }
          
          def code(x, y, z):
          	return math.fabs(((4.0 / y) + ((x / y) * (1.0 - z))))
          
          function code(x, y, z)
          	return abs(Float64(Float64(4.0 / y) + Float64(Float64(x / y) * Float64(1.0 - z))))
          end
          
          function tmp = code(x, y, z)
          	tmp = abs(((4.0 / y) + ((x / y) * (1.0 - z))));
          end
          
          code[x_, y_, z_] := N[Abs[N[(N[(4.0 / y), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right|
          \end{array}
          
          Derivation
          1. Initial program 89.9%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified97.3%

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

          Alternative 12: 96.2% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \left|\frac{\left(x + 4\right) - x \cdot z}{y}\right| \end{array} \]
          (FPCore (x y z) :precision binary64 (fabs (/ (- (+ x 4.0) (* x z)) y)))
          double code(double x, double y, double z) {
          	return fabs((((x + 4.0) - (x * 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 = abs((((x + 4.0d0) - (x * z)) / y))
          end function
          
          public static double code(double x, double y, double z) {
          	return Math.abs((((x + 4.0) - (x * z)) / y));
          }
          
          def code(x, y, z):
          	return math.fabs((((x + 4.0) - (x * z)) / y))
          
          function code(x, y, z)
          	return abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y))
          end
          
          function tmp = code(x, y, z)
          	tmp = abs((((x + 4.0) - (x * z)) / y));
          end
          
          code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|
          \end{array}
          
          Derivation
          1. Initial program 89.9%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x \cdot z}{y}\right)\right) \]
            3. sub-divN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\left(x + 4\right) - x \cdot z}{y}\right)\right) \]
            4. flip3-+N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\frac{{x}^{3} + {4}^{3}}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)} - x \cdot z}{y}\right)\right) \]
            5. div-invN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\left({x}^{3} + {4}^{3}\right) \cdot \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)} - x \cdot z}{y}\right)\right) \]
            6. fmm-defN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(x \cdot z\right)\right)}{y}\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(z \cdot x\right)\right)}{y}\right)\right) \]
            8. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{fma}\left({x}^{3} + {4}^{3}, \frac{1}{x \cdot x + \left(4 \cdot 4 - x \cdot 4\right)}, \mathsf{neg}\left(z \cdot x\right)\right)\right), y\right)\right) \]
          4. Applied egg-rr97.0%

            \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
          5. Final simplification97.0%

            \[\leadsto \left|\frac{\left(x + 4\right) - x \cdot z}{y}\right| \]
          6. Add Preprocessing

          Alternative 13: 46.2% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
          (FPCore (x y z) :precision binary64 (if (<= x 4.0) (fabs (/ 4.0 y)) (/ x y)))
          double code(double x, double y, double z) {
          	double tmp;
          	if (x <= 4.0) {
          		tmp = fabs((4.0 / y));
          	} else {
          		tmp = 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 (x <= 4.0d0) then
                  tmp = abs((4.0d0 / y))
              else
                  tmp = x / y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double tmp;
          	if (x <= 4.0) {
          		tmp = Math.abs((4.0 / y));
          	} else {
          		tmp = x / y;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	tmp = 0
          	if x <= 4.0:
          		tmp = math.fabs((4.0 / y))
          	else:
          		tmp = x / y
          	return tmp
          
          function code(x, y, z)
          	tmp = 0.0
          	if (x <= 4.0)
          		tmp = abs(Float64(4.0 / y));
          	else
          		tmp = Float64(x / y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	tmp = 0.0;
          	if (x <= 4.0)
          		tmp = abs((4.0 / y));
          	else
          		tmp = x / y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := If[LessEqual[x, 4.0], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], N[(x / y), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq 4:\\
          \;\;\;\;\left|\frac{4}{y}\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 4

            1. Initial program 92.3%

              \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
            2. Step-by-step derivation
              1. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
              2. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
              4. neg-sub0N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
              5. associate-+l-N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              6. sub0-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
              7. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              8. distribute-rgt-out--N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              10. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              11. associate-*l/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
              12. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
              13. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
              14. distribute-neg-inN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
              15. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
              16. div-subN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
              17. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
              19. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              20. +-lowering-+.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              21. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              22. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
            3. Simplified96.5%

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{4}{y}\right)}\right) \]
            6. Step-by-step derivation
              1. /-lowering-/.f6448.4%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(4, y\right)\right) \]
            7. Simplified48.4%

              \[\leadsto \left|\color{blue}{\frac{4}{y}}\right| \]

            if 4 < x

            1. Initial program 83.0%

              \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
            2. Step-by-step derivation
              1. fabs-lowering-fabs.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
              2. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
              4. neg-sub0N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
              5. associate-+l-N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              6. sub0-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
              7. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
              8. distribute-rgt-out--N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              10. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
              11. associate-*l/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
              12. *-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
              13. neg-mul-1N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
              14. distribute-neg-inN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
              15. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
              16. div-subN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
              17. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
              19. +-commutativeN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              20. +-lowering-+.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              21. /-lowering-/.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
              22. sub-negN/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
            3. Simplified99.9%

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
            6. Step-by-step derivation
              1. div-subN/A

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

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
              3. /-lowering-/.f64N/A

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

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

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

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

              \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}\right) \]
            9. Step-by-step derivation
              1. /-lowering-/.f6470.2%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, y\right)\right) \]
            10. Simplified70.2%

              \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]
            11. Step-by-step derivation
              1. clear-numN/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{\frac{y}{x}}\right)\right) \]
              2. associate-/r/N/A

                \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{y} \cdot x\right)\right) \]
              3. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{y}\right), x\right)\right) \]
              4. /-lowering-/.f6470.1%

                \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, y\right), x\right)\right) \]
            12. Applied egg-rr70.1%

              \[\leadsto \left|\color{blue}{\frac{1}{y} \cdot x}\right| \]
            13. Step-by-step derivation
              1. associate-/r/N/A

                \[\leadsto \left|\frac{1}{\frac{y}{x}}\right| \]
              2. inv-powN/A

                \[\leadsto \left|{\left(\frac{y}{x}\right)}^{-1}\right| \]
              3. sqr-powN/A

                \[\leadsto \left|{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}\right| \]
              4. fabs-sqrN/A

                \[\leadsto {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}} \]
              5. sqr-powN/A

                \[\leadsto {\left(\frac{y}{x}\right)}^{\color{blue}{-1}} \]
              6. inv-powN/A

                \[\leadsto \frac{1}{\color{blue}{\frac{y}{x}}} \]
              7. clear-numN/A

                \[\leadsto \frac{x}{\color{blue}{y}} \]
              8. /-lowering-/.f6430.0%

                \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
            14. Applied egg-rr30.0%

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

          Alternative 14: 17.8% accurate, 37.0× speedup?

          \[\begin{array}{l} \\ \frac{x}{y} \end{array} \]
          (FPCore (x y z) :precision binary64 (/ x y))
          double code(double x, double y, double z) {
          	return x / 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
          end function
          
          public static double code(double x, double y, double z) {
          	return x / y;
          }
          
          def code(x, y, z):
          	return x / y
          
          function code(x, y, z)
          	return Float64(x / y)
          end
          
          function tmp = code(x, y, z)
          	tmp = x / y;
          end
          
          code[x_, y_, z_] := N[(x / y), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{x}{y}
          \end{array}
          
          Derivation
          1. Initial program 89.9%

            \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \]
          2. Step-by-step derivation
            1. fabs-lowering-fabs.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} - \frac{x}{y} \cdot z\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x + 4}{y} + \left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right)\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \frac{x + 4}{y}\right)\right) \]
            4. neg-sub0N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(0 - \frac{x}{y} \cdot z\right) + \frac{x + 4}{y}\right)\right) \]
            5. associate-+l-N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(0 - \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            6. sub0-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\mathsf{neg}\left(\left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right)\right) \]
            7. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z - \frac{x + 4}{y}\right)\right)\right) \]
            8. distribute-rgt-out--N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\frac{x}{y} \cdot z\right) \cdot -1 - \frac{x + 4}{y} \cdot -1\right)\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(-1 \cdot \left(\frac{x}{y} \cdot z\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            10. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{x + 4}{y} \cdot -1\right)\right) \]
            11. associate-*l/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(x + 4\right) \cdot -1}{y}\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{-1 \cdot \left(x + 4\right)}{y}\right)\right) \]
            13. neg-mul-1N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\mathsf{neg}\left(\left(x + 4\right)\right)}{y}\right)\right) \]
            14. distribute-neg-inN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) + \left(\mathsf{neg}\left(4\right)\right)}{y}\right)\right) \]
            15. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \frac{\left(\mathsf{neg}\left(x\right)\right) - 4}{y}\right)\right) \]
            16. div-subN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\frac{\mathsf{neg}\left(x\right)}{y} - \frac{4}{y}\right)\right)\right) \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right) + \frac{4}{y}\right)\right) \]
            19. +-commutativeN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{4}{y} + \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            20. +-lowering-+.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\left(\frac{4}{y}\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            21. /-lowering-/.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) - \left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right) \]
            22. sub-negN/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
          3. Simplified97.3%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(x \cdot \left(\frac{1}{y} - \frac{z}{y}\right)\right)}\right) \]
          6. Step-by-step derivation
            1. div-subN/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{x \cdot \left(1 - z\right)}{y}\right)\right) \]
            3. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 - z\right)\right), y\right)\right) \]
            5. --lowering--.f6463.4%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, z\right)\right), y\right)\right) \]
          7. Simplified63.4%

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

            \[\leadsto \mathsf{fabs.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}\right) \]
          9. Step-by-step derivation
            1. /-lowering-/.f6438.3%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(x, y\right)\right) \]
          10. Simplified38.3%

            \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]
          11. Step-by-step derivation
            1. clear-numN/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{\frac{y}{x}}\right)\right) \]
            2. associate-/r/N/A

              \[\leadsto \mathsf{fabs.f64}\left(\left(\frac{1}{y} \cdot x\right)\right) \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{y}\right), x\right)\right) \]
            4. /-lowering-/.f6438.3%

              \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, y\right), x\right)\right) \]
          12. Applied egg-rr38.3%

            \[\leadsto \left|\color{blue}{\frac{1}{y} \cdot x}\right| \]
          13. Step-by-step derivation
            1. associate-/r/N/A

              \[\leadsto \left|\frac{1}{\frac{y}{x}}\right| \]
            2. inv-powN/A

              \[\leadsto \left|{\left(\frac{y}{x}\right)}^{-1}\right| \]
            3. sqr-powN/A

              \[\leadsto \left|{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}\right| \]
            4. fabs-sqrN/A

              \[\leadsto {\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{\left(\frac{y}{x}\right)}^{\left(\frac{-1}{2}\right)}} \]
            5. sqr-powN/A

              \[\leadsto {\left(\frac{y}{x}\right)}^{\color{blue}{-1}} \]
            6. inv-powN/A

              \[\leadsto \frac{1}{\color{blue}{\frac{y}{x}}} \]
            7. clear-numN/A

              \[\leadsto \frac{x}{\color{blue}{y}} \]
            8. /-lowering-/.f6418.0%

              \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
          14. Applied egg-rr18.0%

            \[\leadsto \color{blue}{\frac{x}{y}} \]
          15. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2024138 
          (FPCore (x y z)
            :name "fabs fraction 1"
            :precision binary64
            (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))