fabs fraction 1

Percentage Accurate: 92.3% → 99.8%
Time: 12.5s
Alternatives: 12
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 12 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.3% 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.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \leq 5 \cdot 10^{+27}:\\ \;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\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))) 5e+27)
   (fabs (/ (- (+ x 4.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))) <= 5e+27) {
		tmp = fabs((((x + 4.0) - (x * z)) / y));
	} else {
		tmp = fabs(((4.0 / y) + ((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 (abs((((x + 4.0d0) / y) - ((x / y) * z))) <= 5d+27) then
        tmp = abs((((x + 4.0d0) - (x * z)) / y))
    else
        tmp = abs(((4.0d0 / y) + ((x / y) * (1.0d0 - z))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (Math.abs((((x + 4.0) / y) - ((x / y) * z))) <= 5e+27) {
		tmp = Math.abs((((x + 4.0) - (x * z)) / y));
	} else {
		tmp = Math.abs(((4.0 / y) + ((x / y) * (1.0 - z))));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if math.fabs((((x + 4.0) / y) - ((x / y) * z))) <= 5e+27:
		tmp = math.fabs((((x + 4.0) - (x * z)) / y))
	else:
		tmp = math.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))) <= 5e+27)
		tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y));
	else
		tmp = abs(Float64(Float64(4.0 / y) + Float64(Float64(x / y) * Float64(1.0 - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (abs((((x + 4.0) / y) - ((x / y) * z))) <= 5e+27)
		tmp = abs((((x + 4.0) - (x * z)) / y));
	else
		tmp = abs(((4.0 / y) + ((x / y) * (1.0 - z))));
	end
	tmp_2 = 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], 5e+27], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $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 5 \cdot 10^{+27}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\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))) < 4.99999999999999979e27

    1. Initial program 94.4%

      \[\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|} \]

    if 4.99999999999999979e27 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)))

    1. Initial program 90.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. 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 5 \cdot 10^{+27}:\\ \;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.3% 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.56:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.95 \cdot 10^{-18}:\\ \;\;\;\;\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 -1.56)
     t_0
     (if (<= x 2.95e-18) (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 <= -1.56) {
		tmp = t_0;
	} else if (x <= 2.95e-18) {
		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 <= (-1.56d0)) then
        tmp = t_0
    else if (x <= 2.95d-18) 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 <= -1.56) {
		tmp = t_0;
	} else if (x <= 2.95e-18) {
		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 <= -1.56:
		tmp = t_0
	elif x <= 2.95e-18:
		tmp = math.fabs(((4.0 - (x * z)) / 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.56)
		tmp = t_0;
	elseif (x <= 2.95e-18)
		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 <= -1.56)
		tmp = t_0;
	elseif (x <= 2.95e-18)
		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[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.56], t$95$0, If[LessEqual[x, 2.95e-18], 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}{y} \cdot \left(1 - z\right)\right|\\
\mathbf{if}\;x \leq -1.56:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 2.95 \cdot 10^{-18}:\\
\;\;\;\;\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 < -1.5600000000000001 or 2.9500000000000001e-18 < x

    1. Initial program 88.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. 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.6%

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

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

    if -1.5600000000000001 < x < 2.9500000000000001e-18

    1. Initial program 96.0%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.56:\\ \;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\ \mathbf{elif}\;x \leq 2.95 \cdot 10^{-18}:\\ \;\;\;\;\left|\frac{4 - x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 74.6% 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.7 \cdot 10^{-37}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-26}:\\ \;\;\;\;\frac{1}{\frac{1}{\frac{4 + \left(x - x \cdot z\right)}{y}}}\\ \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.7e-37)
         t_0
         (if (<= x 1.2e-26) (/ 1.0 (/ 1.0 (/ (+ 4.0 (- x (* 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 <= -1.7e-37) {
    		tmp = t_0;
    	} else if (x <= 1.2e-26) {
    		tmp = 1.0 / (1.0 / ((4.0 + (x - (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 <= (-1.7d-37)) then
            tmp = t_0
        else if (x <= 1.2d-26) then
            tmp = 1.0d0 / (1.0d0 / ((4.0d0 + (x - (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 <= -1.7e-37) {
    		tmp = t_0;
    	} else if (x <= 1.2e-26) {
    		tmp = 1.0 / (1.0 / ((4.0 + (x - (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 <= -1.7e-37:
    		tmp = t_0
    	elif x <= 1.2e-26:
    		tmp = 1.0 / (1.0 / ((4.0 + (x - (x * z))) / 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.7e-37)
    		tmp = t_0;
    	elseif (x <= 1.2e-26)
    		tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(4.0 + Float64(x - 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 <= -1.7e-37)
    		tmp = t_0;
    	elseif (x <= 1.2e-26)
    		tmp = 1.0 / (1.0 / ((4.0 + (x - (x * z))) / 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.7e-37], t$95$0, If[LessEqual[x, 1.2e-26], N[(1.0 / N[(1.0 / N[(N[(4.0 + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $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.7 \cdot 10^{-37}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 1.2 \cdot 10^{-26}:\\
    \;\;\;\;\frac{1}{\frac{1}{\frac{4 + \left(x - x \cdot z\right)}{y}}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -1.70000000000000009e-37 or 1.2e-26 < x

      1. Initial program 88.8%

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

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

        \[\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.70000000000000009e-37 < x < 1.2e-26

      1. Initial program 95.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-rr100.0%

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(1, \left(\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|\right)\right) \]
        7. *-lft-identityN/A

          \[\leadsto \mathsf{/.f64}\left(1, \left(\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|\right)\right) \]
        8. inv-powN/A

          \[\leadsto \mathsf{/.f64}\left(1, \left(\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|\right)\right) \]
        9. sqr-powN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \left({\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\left(\frac{-1}{2}\right)}}\right)\right) \]
        11. sqr-powN/A

          \[\leadsto \mathsf{/.f64}\left(1, \left({\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}\right)\right) \]
        12. inv-powN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}\right)\right) \]
        14. *-lft-identityN/A

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

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

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

          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \left(\frac{4 + x}{y} - \frac{x \cdot z}{y}\right)\right)\right) \]
      8. Applied egg-rr50.1%

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

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

    Alternative 4: 73.7% accurate, 1.0× speedup?

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

      1. Initial program 91.8%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, \color{blue}{\left(-1 \cdot \left(x \cdot z\right)\right)}\right), y\right) \]
      10. Step-by-step derivation
        1. mul-1-negN/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, \mathsf{\_.f64}\left(0, \left(x \cdot z\right)\right)\right), y\right) \]
        4. *-lowering-*.f6439.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(x, z\right)\right)\right), y\right) \]
      11. Simplified39.3%

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

      if -8.4e15 < z < 6.3000000000000001e28

      1. Initial program 91.8%

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

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

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

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

    Alternative 5: 97.9% accurate, 1.0× speedup?

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

      1. Initial program 93.8%

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

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

      if 1.3e16 < x

      1. Initial program 86.2%

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

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

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

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

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

    Alternative 6: 55.6% accurate, 1.0× speedup?

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

      1. Initial program 84.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.5%

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

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

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

      if -6.6000000000000003e-18 < x < 3.0000000000000001e155

      1. Initial program 96.3%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

    Alternative 7: 44.0% accurate, 5.0× speedup?

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

      1. Initial program 77.4%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{y}} \]
      10. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto 0 - \color{blue}{\frac{x \cdot z}{y}} \]
        3. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{x \cdot z}{y}\right)}\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{z \cdot x}{y}\right)\right) \]
        5. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \left(z \cdot \color{blue}{\frac{x}{y}}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{x}{y}\right)}\right)\right) \]
        7. /-lowering-/.f6433.2%

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
      11. Simplified33.2%

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

      if -1.89999999999999994e110 < x < 1220

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, \color{blue}{\left(-1 \cdot \left(x \cdot z\right)\right)}\right), y\right) \]
      10. Step-by-step derivation
        1. mul-1-negN/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, \mathsf{\_.f64}\left(0, \left(x \cdot z\right)\right)\right), y\right) \]
        4. *-lowering-*.f6442.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(x, z\right)\right)\right), y\right) \]
      11. Simplified42.6%

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

      if 1220 < x < 1.79999999999999989e156

      1. Initial program 96.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-rr91.9%

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)\right), y\right) \]
        3. mul-1-negN/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 + -1 \cdot z\right)\right), y\right) \]
        5. mul-1-negN/A

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

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

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

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

      if 1.79999999999999989e156 < x

      1. Initial program 75.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-rr94.0%

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{\frac{4 + x}{y}} \]
      10. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(4 + x\right), \color{blue}{y}\right) \]
        2. +-lowering-+.f6438.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, x\right), y\right) \]
      11. Simplified38.4%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{+110}:\\ \;\;\;\;\frac{x}{y} \cdot \left(0 - z\right)\\ \mathbf{elif}\;x \leq 1220:\\ \;\;\;\;\frac{4 - x \cdot z}{y}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+156}:\\ \;\;\;\;\frac{x \cdot \left(1 - z\right)}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 4}{y}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 38.1% accurate, 5.0× speedup?

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

      1. Initial program 87.0%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{y}} \]
      10. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto 0 - \color{blue}{\frac{x \cdot z}{y}} \]
        3. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{x \cdot z}{y}\right)}\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{z \cdot x}{y}\right)\right) \]
        5. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \left(z \cdot \color{blue}{\frac{x}{y}}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{x}{y}\right)}\right)\right) \]
        7. /-lowering-/.f6427.2%

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
      11. Simplified27.2%

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

      if -9.8e13 < x < 2.9500000000000001e-18

      1. Initial program 96.2%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{\frac{4}{y}} \]
      10. Step-by-step derivation
        1. /-lowering-/.f6436.7%

          \[\leadsto \mathsf{/.f64}\left(4, \color{blue}{y}\right) \]
      11. Simplified36.7%

        \[\leadsto \color{blue}{\frac{4}{y}} \]

      if 2.9500000000000001e-18 < x < 5.2000000000000004e155

      1. Initial program 97.5%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)\right), y\right) \]
        3. mul-1-negN/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(1 + -1 \cdot z\right)\right), y\right) \]
        5. mul-1-negN/A

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

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

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

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

      if 5.2000000000000004e155 < x

      1. Initial program 75.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-rr94.0%

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{\frac{4 + x}{y}} \]
      10. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(4 + x\right), \color{blue}{y}\right) \]
        2. +-lowering-+.f6438.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, x\right), y\right) \]
      11. Simplified38.4%

        \[\leadsto \color{blue}{\frac{4 + x}{y}} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification35.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -98000000000000:\\ \;\;\;\;\frac{x}{y} \cdot \left(0 - z\right)\\ \mathbf{elif}\;x \leq 2.95 \cdot 10^{-18}:\\ \;\;\;\;\frac{4}{y}\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+155}:\\ \;\;\;\;\frac{x \cdot \left(1 - z\right)}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 4}{y}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 44.7% accurate, 5.8× speedup?

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

      1. Initial program 88.3%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{y}} \]
      10. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto 0 - \color{blue}{\frac{x \cdot z}{y}} \]
        3. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{x \cdot z}{y}\right)}\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{z \cdot x}{y}\right)\right) \]
        5. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \left(z \cdot \color{blue}{\frac{x}{y}}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{x}{y}\right)}\right)\right) \]
        7. /-lowering-/.f6426.6%

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
      11. Simplified26.6%

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

      if -920 < x < 1.2e157

      1. Initial program 96.4%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

      if 1.2e157 < x

      1. Initial program 75.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-rr94.0%

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{\frac{4 + x}{y}} \]
      10. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(4 + x\right), \color{blue}{y}\right) \]
        2. +-lowering-+.f6438.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, x\right), y\right) \]
      11. Simplified38.4%

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

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

    Alternative 10: 35.8% accurate, 9.2× speedup?

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

      1. Initial program 88.3%

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

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{y}} \]
      10. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto 0 - \color{blue}{\frac{x \cdot z}{y}} \]
        3. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{x \cdot z}{y}\right)}\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(0, \left(\frac{z \cdot x}{y}\right)\right) \]
        5. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \left(z \cdot \color{blue}{\frac{x}{y}}\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \color{blue}{\left(\frac{x}{y}\right)}\right)\right) \]
        7. /-lowering-/.f6426.6%

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(z, \mathsf{/.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
      11. Simplified26.6%

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

      if -4 < x

      1. Initial program 92.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.5%

        \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
      5. Step-by-step derivation
        1. fabs-divN/A

          \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
        2. clear-numN/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
        4. div-fabsN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
      7. Step-by-step derivation
        1. clear-numN/A

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

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
        3. div-subN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
        4. associate-/l*N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
        5. *-commutativeN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
        6. associate-/r/N/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
        8. inv-powN/A

          \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
        9. sqr-powN/A

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

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

          \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
        12. inv-powN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
        13. clear-numN/A

          \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
        14. /-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{\frac{4 + x}{y}} \]
      10. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(4 + x\right), \color{blue}{y}\right) \]
        2. +-lowering-+.f6435.0%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(4, x\right), y\right) \]
      11. Simplified35.0%

        \[\leadsto \color{blue}{\frac{4 + x}{y}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification33.0%

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

    Alternative 11: 35.4% accurate, 22.2× speedup?

    \[\begin{array}{l} \\ \frac{x + 4}{y} \end{array} \]
    (FPCore (x y z) :precision binary64 (/ (+ x 4.0) y))
    double code(double x, double y, double z) {
    	return (x + 4.0) / 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 + 4.0d0) / y
    end function
    
    public static double code(double x, double y, double z) {
    	return (x + 4.0) / y;
    }
    
    def code(x, y, z):
    	return (x + 4.0) / y
    
    function code(x, y, z)
    	return Float64(Float64(x + 4.0) / y)
    end
    
    function tmp = code(x, y, z)
    	tmp = (x + 4.0) / y;
    end
    
    code[x_, y_, z_] := N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{x + 4}{y}
    \end{array}
    
    Derivation
    1. Initial program 91.8%

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

      \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
    5. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
      4. div-fabsN/A

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
    7. Step-by-step derivation
      1. clear-numN/A

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

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
      3. div-subN/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
      4. associate-/l*N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
      5. *-commutativeN/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
      6. associate-/r/N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
      7. *-lft-identityN/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
      8. inv-powN/A

        \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
      9. sqr-powN/A

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

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

        \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
      12. inv-powN/A

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
      13. clear-numN/A

        \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
      14. /-rgt-identityN/A

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

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

      \[\leadsto \color{blue}{\frac{4 + x}{y}} \]
    10. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(4 + x\right), \color{blue}{y}\right) \]
      2. +-lowering-+.f6433.8%

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

      \[\leadsto \color{blue}{\frac{4 + x}{y}} \]
    12. Final simplification33.8%

      \[\leadsto \frac{x + 4}{y} \]
    13. Add Preprocessing

    Alternative 12: 21.3% accurate, 37.0× speedup?

    \[\begin{array}{l} \\ \frac{4}{y} \end{array} \]
    (FPCore (x y z) :precision binary64 (/ 4.0 y))
    double code(double x, double y, double z) {
    	return 4.0 / y;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        code = 4.0d0 / y
    end function
    
    public static double code(double x, double y, double z) {
    	return 4.0 / y;
    }
    
    def code(x, y, z):
    	return 4.0 / y
    
    function code(x, y, z)
    	return Float64(4.0 / y)
    end
    
    function tmp = code(x, y, z)
    	tmp = 4.0 / y;
    end
    
    code[x_, y_, z_] := N[(4.0 / y), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{4}{y}
    \end{array}
    
    Derivation
    1. Initial program 91.8%

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

      \[\leadsto \color{blue}{\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|} \]
    5. Step-by-step derivation
      1. fabs-divN/A

        \[\leadsto \frac{\left|\left(4 + x\right) - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
      2. clear-numN/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left|y\right|}{\left|\left(4 + x\right) - x \cdot z\right|}\right)}\right) \]
      4. div-fabsN/A

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\left|\frac{y}{4 + \left(x - x \cdot z\right)}\right|}} \]
    7. Step-by-step derivation
      1. clear-numN/A

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

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{\left(4 + x\right) - x \cdot z}{y}}\right|} \]
      3. div-subN/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{x \cdot z}{y}}\right|} \]
      4. associate-/l*N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - x \cdot \frac{z}{y}}\right|} \]
      5. *-commutativeN/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{y} \cdot x}\right|} \]
      6. associate-/r/N/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}}\right|} \]
      7. *-lft-identityN/A

        \[\leadsto \frac{1}{\left|\frac{1}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}\right|} \]
      8. inv-powN/A

        \[\leadsto \frac{1}{\left|{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{-1}\right|} \]
      9. sqr-powN/A

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

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

        \[\leadsto \frac{1}{{\left(\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}\right)}^{\color{blue}{-1}}} \]
      12. inv-powN/A

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}}} \]
      13. clear-numN/A

        \[\leadsto \frac{\frac{4 + x}{y} - 1 \cdot \frac{z}{\frac{y}{x}}}{\color{blue}{1}} \]
      14. /-rgt-identityN/A

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

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

      \[\leadsto \color{blue}{\frac{4}{y}} \]
    10. Step-by-step derivation
      1. /-lowering-/.f6419.8%

        \[\leadsto \mathsf{/.f64}\left(4, \color{blue}{y}\right) \]
    11. Simplified19.8%

      \[\leadsto \color{blue}{\frac{4}{y}} \]
    12. Add Preprocessing

    Reproduce

    ?
    herbie shell --seed 2024139 
    (FPCore (x y z)
      :name "fabs fraction 1"
      :precision binary64
      (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))