Numeric.SpecFunctions:choose from math-functions-0.1.5.2

Percentage Accurate: 84.6% → 96.8%
Time: 6.1s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 84.6% accurate, 1.0× speedup?

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

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

Alternative 1: 96.8% accurate, 0.1× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 3.5 \cdot 10^{-192}:\\ \;\;\;\;x\_m \cdot \left(\frac{y}{z} - -1\right)\\ \mathbf{elif}\;x\_m \leq 3.1 \cdot 10^{+14}:\\ \;\;\;\;\frac{x\_m \cdot \left(y + z\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x\_m, \frac{y}{z}, x\_m\right)\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
 :precision binary64
 (*
  x_s
  (if (<= x_m 3.5e-192)
    (* x_m (- (/ y z) -1.0))
    (if (<= x_m 3.1e+14) (/ (* x_m (+ y z)) z) (fma x_m (/ y z) x_m)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
	double tmp;
	if (x_m <= 3.5e-192) {
		tmp = x_m * ((y / z) - -1.0);
	} else if (x_m <= 3.1e+14) {
		tmp = (x_m * (y + z)) / z;
	} else {
		tmp = fma(x_m, (y / z), x_m);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z)
	tmp = 0.0
	if (x_m <= 3.5e-192)
		tmp = Float64(x_m * Float64(Float64(y / z) - -1.0));
	elseif (x_m <= 3.1e+14)
		tmp = Float64(Float64(x_m * Float64(y + z)) / z);
	else
		tmp = fma(x_m, Float64(y / z), x_m);
	end
	return Float64(x_s * tmp)
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[x$95$m, 3.5e-192], N[(x$95$m * N[(N[(y / z), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$95$m, 3.1e+14], N[(N[(x$95$m * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x$95$m * N[(y / z), $MachinePrecision] + x$95$m), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 3.5 \cdot 10^{-192}:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - -1\right)\\

\mathbf{elif}\;x\_m \leq 3.1 \cdot 10^{+14}:\\
\;\;\;\;\frac{x\_m \cdot \left(y + z\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x\_m, \frac{y}{z}, x\_m\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 3.50000000000000014e-192

    1. Initial program 82.9%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*94.9%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg94.9%

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

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

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

        \[\leadsto x \cdot \left(0 - \frac{y + \color{blue}{\left(-\left(-z\right)\right)}}{-z}\right) \]
      6. unsub-neg94.9%

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-94.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub094.9%

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

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

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

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

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

    if 3.50000000000000014e-192 < x < 3.1e14

    1. Initial program 97.4%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Add Preprocessing

    if 3.1e14 < x

    1. Initial program 74.8%

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(-y\right) + \color{blue}{\left(-z\right) \cdot x}}{-z} \]
      8. cancel-sign-sub-inv74.6%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{-y}{-z}} - \frac{z \cdot x}{-z} \]
      11. distribute-neg-frac76.4%

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

        \[\leadsto x \cdot \color{blue}{\frac{y}{-\left(-z\right)}} - \frac{z \cdot x}{-z} \]
      13. remove-double-neg76.4%

        \[\leadsto x \cdot \frac{y}{\color{blue}{z}} - \frac{z \cdot x}{-z} \]
      14. fma-neg76.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, -\frac{z \cdot x}{-z}\right)} \]
      15. distribute-frac-neg76.4%

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{z}, \color{blue}{\frac{-z \cdot x}{-z}}\right) \]
      16. distribute-lft-neg-out76.4%

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{z}, \frac{\color{blue}{\left(-z\right) \cdot x}}{-z}\right) \]
      17. *-commutative76.4%

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

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

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{z}, x \cdot \color{blue}{1}\right) \]
      20. *-rgt-identity99.9%

        \[\leadsto \mathsf{fma}\left(x, \frac{y}{z}, \color{blue}{x}\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, x\right)} \]
    4. Add Preprocessing
  3. Recombined 3 regimes into one program.
  4. Final simplification96.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.5 \cdot 10^{-192}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - -1\right)\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{+14}:\\ \;\;\;\;\frac{x \cdot \left(y + z\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{y}{z}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 95.6% accurate, 0.4× speedup?

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

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+148} \lor \neg \left(y \leq 2 \cdot 10^{+50}\right):\\
\;\;\;\;\left(y + z\right) \cdot \frac{x\_m}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1500000000000001e148 or 2.0000000000000002e50 < y

    1. Initial program 85.7%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. *-commutative85.7%

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

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

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

    if -2.1500000000000001e148 < y < 2.0000000000000002e50

    1. Initial program 82.3%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg99.9%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-99.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub099.9%

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

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

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

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

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

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

Alternative 3: 95.6% accurate, 0.4× speedup?

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

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+148} \lor \neg \left(y \leq 3.05 \cdot 10^{+57}\right):\\
\;\;\;\;\left(y + z\right) \cdot \frac{x\_m}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.80000000000000003e148 or 3.04999999999999988e57 < y

    1. Initial program 85.7%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. *-commutative85.7%

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

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

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

    if -1.80000000000000003e148 < y < 3.04999999999999988e57

    1. Initial program 82.3%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg99.9%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-99.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub099.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+148} \lor \neg \left(y \leq 3.05 \cdot 10^{+57}\right):\\ \;\;\;\;\left(y + z\right) \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 96.8% accurate, 0.4× speedup?

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

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 8.5 \cdot 10^{-191}:\\
\;\;\;\;x\_m \cdot \left(\frac{y}{z} - -1\right)\\

\mathbf{elif}\;x\_m \leq 200000000:\\
\;\;\;\;\frac{x\_m \cdot \left(y + z\right)}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 8.49999999999999954e-191

    1. Initial program 82.9%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*94.9%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg94.9%

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

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

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

        \[\leadsto x \cdot \left(0 - \frac{y + \color{blue}{\left(-\left(-z\right)\right)}}{-z}\right) \]
      6. unsub-neg94.9%

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-94.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub094.9%

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

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

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

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

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

    if 8.49999999999999954e-191 < x < 2e8

    1. Initial program 97.4%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Add Preprocessing

    if 2e8 < x

    1. Initial program 74.8%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg99.9%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-99.9%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub099.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 70.0% accurate, 0.5× speedup?

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

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-5} \lor \neg \left(y \leq 6.2 \cdot 10^{+79}\right):\\
\;\;\;\;x\_m \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.00000000000000008e-5 or 6.1999999999999998e79 < y

    1. Initial program 89.1%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*89.2%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg89.2%

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

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

        \[\leadsto x \cdot \color{blue}{\left(0 - \frac{y + z}{-z}\right)} \]
      5. remove-double-neg89.2%

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-89.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub089.2%

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

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

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

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

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

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

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

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

    if -3.00000000000000008e-5 < y < 6.1999999999999998e79

    1. Initial program 79.0%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*98.6%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg98.6%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{1}\right)\right) \]
      9. metadata-eval98.6%

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-98.6%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub098.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\frac{y}{-z}\right)} + \left(--1\right)\right) \]
      12. distribute-frac-neg298.6%

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

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

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

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

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

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

Alternative 6: 72.7% accurate, 0.5× speedup?

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

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-7} \lor \neg \left(y \leq 6.2 \cdot 10^{+79}\right):\\
\;\;\;\;y \cdot \frac{x\_m}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.9999999999999999e-7 or 6.1999999999999998e79 < y

    1. Initial program 89.1%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*89.2%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg89.2%

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

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

        \[\leadsto x \cdot \color{blue}{\left(0 - \frac{y + z}{-z}\right)} \]
      5. remove-double-neg89.2%

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-89.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub089.2%

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-7 < y < 6.1999999999999998e79

    1. Initial program 79.0%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*98.6%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg98.6%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{1}\right)\right) \]
      9. metadata-eval98.6%

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-98.6%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub098.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\frac{y}{-z}\right)} + \left(--1\right)\right) \]
      12. distribute-frac-neg298.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-7} \lor \neg \left(y \leq 6.2 \cdot 10^{+79}\right):\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 72.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 8 \cdot 10^{+79}:\\
\;\;\;\;x\_m\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.2500000000000001e-6

    1. Initial program 91.7%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*90.4%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg90.4%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{1}\right)\right) \]
      9. metadata-eval90.4%

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-90.4%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub090.4%

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

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

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

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

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

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

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

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

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

    if -1.2500000000000001e-6 < y < 7.99999999999999974e79

    1. Initial program 79.0%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*98.6%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg98.6%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{1}\right)\right) \]
      9. metadata-eval98.6%

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-98.6%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub098.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\frac{y}{-z}\right)} + \left(--1\right)\right) \]
      12. distribute-frac-neg298.6%

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

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

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

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

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

    if 7.99999999999999974e79 < y

    1. Initial program 84.9%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*87.2%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg87.2%

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

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

        \[\leadsto x \cdot \color{blue}{\left(0 - \frac{y + z}{-z}\right)} \]
      5. remove-double-neg87.2%

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-87.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub087.2%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{-6}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+79}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 72.4% accurate, 0.5× speedup?

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

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -0.48:\\
\;\;\;\;\frac{x\_m \cdot y}{z}\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{+79}:\\
\;\;\;\;x\_m\\

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


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

    1. Initial program 91.7%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*90.4%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg90.4%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{1}\right)\right) \]
      9. metadata-eval90.4%

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-90.4%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub090.4%

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

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

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

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

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

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

    if -0.47999999999999998 < y < 6.1999999999999998e79

    1. Initial program 79.0%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*98.6%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg98.6%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{1}\right)\right) \]
      9. metadata-eval98.6%

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-98.6%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub098.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\frac{y}{-z}\right)} + \left(--1\right)\right) \]
      12. distribute-frac-neg298.6%

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

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

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

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

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

    if 6.1999999999999998e79 < y

    1. Initial program 84.9%

      \[\frac{x \cdot \left(y + z\right)}{z} \]
    2. Step-by-step derivation
      1. associate-/l*87.2%

        \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
      2. remove-double-neg87.2%

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

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

        \[\leadsto x \cdot \color{blue}{\left(0 - \frac{y + z}{-z}\right)} \]
      5. remove-double-neg87.2%

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

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

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

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

        \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
      10. associate--r-87.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
      11. neg-sub087.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 95.6% accurate, 1.0× speedup?

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

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

    \[\frac{x \cdot \left(y + z\right)}{z} \]
  2. Step-by-step derivation
    1. associate-/l*94.4%

      \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
    2. remove-double-neg94.4%

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

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

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

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

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

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

      \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{1}\right)\right) \]
    9. metadata-eval94.4%

      \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
    10. associate--r-94.4%

      \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
    11. neg-sub094.4%

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

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

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

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

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

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

Alternative 10: 50.4% accurate, 7.0× speedup?

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

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

    \[\frac{x \cdot \left(y + z\right)}{z} \]
  2. Step-by-step derivation
    1. associate-/l*94.4%

      \[\leadsto \color{blue}{x \cdot \frac{y + z}{z}} \]
    2. remove-double-neg94.4%

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

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

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

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

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

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

      \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{1}\right)\right) \]
    9. metadata-eval94.4%

      \[\leadsto x \cdot \left(0 - \left(\frac{y}{-z} - \color{blue}{\left(--1\right)}\right)\right) \]
    10. associate--r-94.4%

      \[\leadsto x \cdot \color{blue}{\left(\left(0 - \frac{y}{-z}\right) + \left(--1\right)\right)} \]
    11. neg-sub094.4%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification50.3%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 95.9% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024055 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (/ x (/ z (+ y z)))

  (/ (* x (+ y z)) z))