fabs fraction 1

Percentage Accurate: 91.3% → 99.8%
Time: 11.2s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 91.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 10^{+29}:\\ \;\;\;\;\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))) 1e+29)
   (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))) <= 1e+29) {
		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))) <= 1d+29) 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))) <= 1e+29) {
		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))) <= 1e+29:
		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))) <= 1e+29)
		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))) <= 1e+29)
		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], 1e+29], 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 10^{+29}:\\
\;\;\;\;\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))) < 9.99999999999999914e28

    1. Initial program 94.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-rr99.9%

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

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

    1. Initial program 89.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
  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 10^{+29}:\\ \;\;\;\;\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: 70.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-14}:\\ \;\;\;\;\left|\frac{x}{y} \cdot z\right|\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{-48}:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+96}:\\ \;\;\;\;\left|x \cdot \frac{z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{y}\right|\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1.9e-14)
   (fabs (* (/ x y) z))
   (if (<= x 1.22e-48)
     (fabs (/ 4.0 y))
     (if (<= x 1.4e+96) (fabs (* x (/ z y))) (fabs (/ x y))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.9e-14) {
		tmp = fabs(((x / y) * z));
	} else if (x <= 1.22e-48) {
		tmp = fabs((4.0 / y));
	} else if (x <= 1.4e+96) {
		tmp = fabs((x * (z / y)));
	} else {
		tmp = fabs((x / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-1.9d-14)) then
        tmp = abs(((x / y) * z))
    else if (x <= 1.22d-48) then
        tmp = abs((4.0d0 / y))
    else if (x <= 1.4d+96) then
        tmp = abs((x * (z / y)))
    else
        tmp = abs((x / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.9e-14) {
		tmp = Math.abs(((x / y) * z));
	} else if (x <= 1.22e-48) {
		tmp = Math.abs((4.0 / y));
	} else if (x <= 1.4e+96) {
		tmp = Math.abs((x * (z / y)));
	} else {
		tmp = Math.abs((x / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1.9e-14:
		tmp = math.fabs(((x / y) * z))
	elif x <= 1.22e-48:
		tmp = math.fabs((4.0 / y))
	elif x <= 1.4e+96:
		tmp = math.fabs((x * (z / y)))
	else:
		tmp = math.fabs((x / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1.9e-14)
		tmp = abs(Float64(Float64(x / y) * z));
	elseif (x <= 1.22e-48)
		tmp = abs(Float64(4.0 / y));
	elseif (x <= 1.4e+96)
		tmp = abs(Float64(x * Float64(z / y)));
	else
		tmp = abs(Float64(x / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1.9e-14)
		tmp = abs(((x / y) * z));
	elseif (x <= 1.22e-48)
		tmp = abs((4.0 / y));
	elseif (x <= 1.4e+96)
		tmp = abs((x * (z / y)));
	else
		tmp = abs((x / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1.9e-14], N[Abs[N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.22e-48], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.4e+96], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-14}:\\
\;\;\;\;\left|\frac{x}{y} \cdot z\right|\\

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

\mathbf{elif}\;x \leq 1.4 \cdot 10^{+96}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.9000000000000001e-14

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\frac{1}{\frac{y}{x}} - \frac{z}{\frac{y}{x}}\right| \]
      5. clear-numN/A

        \[\leadsto \left|\frac{x}{y} - \frac{z}{\frac{y}{x}}\right| \]
      6. fabs-subN/A

        \[\leadsto \left|\frac{z}{\frac{y}{x}} - \frac{x}{y}\right| \]
      7. div-invN/A

        \[\leadsto \left|z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right| \]
      8. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, y\right)\right)\right) \]
    12. Simplified62.2%

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

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

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

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

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

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

    if -1.9000000000000001e-14 < x < 1.21999999999999993e-48

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.21999999999999993e-48 < x < 1.4e96

    1. Initial program 99.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 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--.f6488.9%

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

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

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

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

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

        \[\leadsto \left|\frac{1}{\frac{y}{x}} - \frac{z}{\frac{y}{x}}\right| \]
      5. clear-numN/A

        \[\leadsto \left|\frac{x}{y} - \frac{z}{\frac{y}{x}}\right| \]
      6. fabs-subN/A

        \[\leadsto \left|\frac{z}{\frac{y}{x}} - \frac{x}{y}\right| \]
      7. div-invN/A

        \[\leadsto \left|z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right| \]
      8. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4e96 < x

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right|} \]
    4. Add Preprocessing
    5. Taylor expanded in 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--.f6495.3%

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

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

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

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

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

Alternative 3: 67.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|x \cdot \frac{z}{y}\right|\\ \mathbf{if}\;x \leq -1.5 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-49}:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{+98}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{y}\right|\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (fabs (* x (/ z y)))))
   (if (<= x -1.5e-16)
     t_0
     (if (<= x 6.5e-49)
       (fabs (/ 4.0 y))
       (if (<= x 2.9e+98) t_0 (fabs (/ x y)))))))
double code(double x, double y, double z) {
	double t_0 = fabs((x * (z / y)));
	double tmp;
	if (x <= -1.5e-16) {
		tmp = t_0;
	} else if (x <= 6.5e-49) {
		tmp = fabs((4.0 / y));
	} else if (x <= 2.9e+98) {
		tmp = t_0;
	} else {
		tmp = fabs((x / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = abs((x * (z / y)))
    if (x <= (-1.5d-16)) then
        tmp = t_0
    else if (x <= 6.5d-49) then
        tmp = abs((4.0d0 / y))
    else if (x <= 2.9d+98) then
        tmp = t_0
    else
        tmp = abs((x / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.abs((x * (z / y)));
	double tmp;
	if (x <= -1.5e-16) {
		tmp = t_0;
	} else if (x <= 6.5e-49) {
		tmp = Math.abs((4.0 / y));
	} else if (x <= 2.9e+98) {
		tmp = t_0;
	} else {
		tmp = Math.abs((x / y));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.fabs((x * (z / y)))
	tmp = 0
	if x <= -1.5e-16:
		tmp = t_0
	elif x <= 6.5e-49:
		tmp = math.fabs((4.0 / y))
	elif x <= 2.9e+98:
		tmp = t_0
	else:
		tmp = math.fabs((x / y))
	return tmp
function code(x, y, z)
	t_0 = abs(Float64(x * Float64(z / y)))
	tmp = 0.0
	if (x <= -1.5e-16)
		tmp = t_0;
	elseif (x <= 6.5e-49)
		tmp = abs(Float64(4.0 / y));
	elseif (x <= 2.9e+98)
		tmp = t_0;
	else
		tmp = abs(Float64(x / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = abs((x * (z / y)));
	tmp = 0.0;
	if (x <= -1.5e-16)
		tmp = t_0;
	elseif (x <= 6.5e-49)
		tmp = abs((4.0 / y));
	elseif (x <= 2.9e+98)
		tmp = t_0;
	else
		tmp = abs((x / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.5e-16], t$95$0, If[LessEqual[x, 6.5e-49], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.9e+98], t$95$0, N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq 2.9 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.49999999999999997e-16 or 6.49999999999999968e-49 < x < 2.9000000000000001e98

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

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

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

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

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

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

        \[\leadsto \left|\frac{1}{\frac{y}{x}} - \frac{z}{\frac{y}{x}}\right| \]
      5. clear-numN/A

        \[\leadsto \left|\frac{x}{y} - \frac{z}{\frac{y}{x}}\right| \]
      6. fabs-subN/A

        \[\leadsto \left|\frac{z}{\frac{y}{x}} - \frac{x}{y}\right| \]
      7. div-invN/A

        \[\leadsto \left|z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right| \]
      8. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.49999999999999997e-16 < x < 6.49999999999999968e-49

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9000000000000001e98 < x

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right|} \]
    4. Add Preprocessing
    5. Taylor expanded in 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--.f6495.3%

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

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

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

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

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

Alternative 4: 74.0% 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 -540000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-7}:\\ \;\;\;\;\frac{\left|4 - 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 -540000000000.0)
     t_0
     (if (<= x 1.9e-7) (/ (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 <= -540000000000.0) {
		tmp = t_0;
	} else if (x <= 1.9e-7) {
		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 <= (-540000000000.0d0)) then
        tmp = t_0
    else if (x <= 1.9d-7) 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 <= -540000000000.0) {
		tmp = t_0;
	} else if (x <= 1.9e-7) {
		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 <= -540000000000.0:
		tmp = t_0
	elif x <= 1.9e-7:
		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 <= -540000000000.0)
		tmp = t_0;
	elseif (x <= 1.9e-7)
		tmp = Float64(abs(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 <= -540000000000.0)
		tmp = t_0;
	elseif (x <= 1.9e-7)
		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, -540000000000.0], t$95$0, If[LessEqual[x, 1.9e-7], N[(N[Abs[N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $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 -540000000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 1.9 \cdot 10^{-7}:\\
\;\;\;\;\frac{\left|4 - x \cdot z\right|}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4e11 or 1.90000000000000007e-7 < x

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

    if -5.4e11 < x < 1.90000000000000007e-7

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \left|\frac{4}{y} - \frac{x \cdot z}{y}\right| \]
      2. sub-divN/A

        \[\leadsto \left|\frac{4 - x \cdot z}{y}\right| \]
      3. fabs-divN/A

        \[\leadsto \frac{\left|4 - x \cdot z\right|}{\color{blue}{\left|y\right|}} \]
      4. remove-double-divN/A

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

        \[\leadsto \frac{\left|4 - x \cdot z\right|}{\frac{\left|1\right|}{\color{blue}{\left|\frac{1}{y}\right|}}} \]
      6. metadata-evalN/A

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

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

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

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

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

        \[\leadsto \frac{\left|4 - x \cdot z\right|}{\frac{1}{\frac{1}{\color{blue}{y}}}} \]
      12. remove-double-divN/A

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

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

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

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

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

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

Alternative 5: 87.2% 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.85 \cdot 10^{-29}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-50}:\\ \;\;\;\;\left|\frac{4}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (fabs (* (/ x y) (- 1.0 z)))))
   (if (<= x -1.85e-29) t_0 (if (<= x 1.65e-50) (fabs (/ 4.0 y)) t_0))))
double code(double x, double y, double z) {
	double t_0 = fabs(((x / y) * (1.0 - z)));
	double tmp;
	if (x <= -1.85e-29) {
		tmp = t_0;
	} else if (x <= 1.65e-50) {
		tmp = fabs((4.0 / y));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = abs(((x / y) * (1.0d0 - z)))
    if (x <= (-1.85d-29)) then
        tmp = t_0
    else if (x <= 1.65d-50) then
        tmp = abs((4.0d0 / y))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.abs(((x / y) * (1.0 - z)));
	double tmp;
	if (x <= -1.85e-29) {
		tmp = t_0;
	} else if (x <= 1.65e-50) {
		tmp = Math.abs((4.0 / y));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.fabs(((x / y) * (1.0 - z)))
	tmp = 0
	if x <= -1.85e-29:
		tmp = t_0
	elif x <= 1.65e-50:
		tmp = math.fabs((4.0 / y))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = abs(Float64(Float64(x / y) * Float64(1.0 - z)))
	tmp = 0.0
	if (x <= -1.85e-29)
		tmp = t_0;
	elseif (x <= 1.65e-50)
		tmp = abs(Float64(4.0 / y));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = abs(((x / y) * (1.0 - z)));
	tmp = 0.0;
	if (x <= -1.85e-29)
		tmp = t_0;
	elseif (x <= 1.65e-50)
		tmp = abs((4.0 / y));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.85e-29], t$95$0, If[LessEqual[x, 1.65e-50], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8499999999999999e-29 or 1.6499999999999999e-50 < x

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
    3. Simplified99.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--.f6489.9%

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

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

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

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

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

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

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

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

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

    if -1.8499999999999999e-29 < x < 1.6499999999999999e-50

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 97.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{+99}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.9999999999999997e99

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

    if 7.9999999999999997e99 < y

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 85.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+17}:\\ \;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+93}:\\ \;\;\;\;\left|\frac{x + 4}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -5e+17)
   (fabs (/ x (/ y z)))
   (if (<= z 5.5e+93) (fabs (/ (+ x 4.0) y)) (fabs (/ z (/ y x))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -5e+17) {
		tmp = fabs((x / (y / z)));
	} else if (z <= 5.5e+93) {
		tmp = fabs(((x + 4.0) / y));
	} else {
		tmp = fabs((z / (y / x)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-5d+17)) then
        tmp = abs((x / (y / z)))
    else if (z <= 5.5d+93) then
        tmp = abs(((x + 4.0d0) / y))
    else
        tmp = abs((z / (y / x)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -5e+17) {
		tmp = Math.abs((x / (y / z)));
	} else if (z <= 5.5e+93) {
		tmp = Math.abs(((x + 4.0) / y));
	} else {
		tmp = Math.abs((z / (y / x)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -5e+17:
		tmp = math.fabs((x / (y / z)))
	elif z <= 5.5e+93:
		tmp = math.fabs(((x + 4.0) / y))
	else:
		tmp = math.fabs((z / (y / x)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -5e+17)
		tmp = abs(Float64(x / Float64(y / z)));
	elseif (z <= 5.5e+93)
		tmp = abs(Float64(Float64(x + 4.0) / y));
	else
		tmp = abs(Float64(z / Float64(y / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -5e+17)
		tmp = abs((x / (y / z)));
	elseif (z <= 5.5e+93)
		tmp = abs(((x + 4.0) / y));
	else
		tmp = abs((z / (y / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -5e+17], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 5.5e+93], N[Abs[N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+17}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{+93}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5e17

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

      \[\leadsto \color{blue}{\left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right|} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 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--.f6468.5%

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

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

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

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

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

        \[\leadsto \left|\frac{1}{\frac{y}{x}} - \frac{z}{\frac{y}{x}}\right| \]
      5. clear-numN/A

        \[\leadsto \left|\frac{x}{y} - \frac{z}{\frac{y}{x}}\right| \]
      6. fabs-subN/A

        \[\leadsto \left|\frac{z}{\frac{y}{x}} - \frac{x}{y}\right| \]
      7. div-invN/A

        \[\leadsto \left|z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right| \]
      8. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e17 < z < 5.5000000000000003e93

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.5000000000000003e93 < z

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
    3. Simplified94.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--.f6476.4%

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

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

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

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

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

        \[\leadsto \left|\frac{1}{\frac{y}{x}} - \frac{z}{\frac{y}{x}}\right| \]
      5. clear-numN/A

        \[\leadsto \left|\frac{x}{y} - \frac{z}{\frac{y}{x}}\right| \]
      6. fabs-subN/A

        \[\leadsto \left|\frac{z}{\frac{y}{x}} - \frac{x}{y}\right| \]
      7. div-invN/A

        \[\leadsto \left|z \cdot \frac{1}{\frac{y}{x}} - \frac{x}{y}\right| \]
      8. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\frac{\color{blue}{z}}{\frac{y}{x}}\right| \]
    12. Recombined 3 regimes into one program.
    13. Final simplification87.0%

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

    Alternative 8: 97.9% accurate, 1.0× speedup?

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

      1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(4, y\right), \left(\left(\mathsf{neg}\left(\frac{x}{y} \cdot z\right)\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{y}\right)\right)\right)\right)\right)\right)\right) \]
      3. Simplified99.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--.f6484.4%

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

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

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

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

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

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

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

      if -2.00000000000000012e84 < x

      1. Initial program 93.1%

        \[\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|} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification98.4%

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

    Alternative 9: 69.8% accurate, 1.0× speedup?

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

      1. Initial program 86.4%

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

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

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

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

      if -10.5 < x < 4

      1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 10: 41.2% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\color{blue}{\frac{4}{y}}\right| \]
    8. Add Preprocessing

    Reproduce

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