Numeric.SpecFunctions:choose from math-functions-0.1.5.2

Percentage Accurate: 84.1% → 96.3%
Time: 5.8s
Alternatives: 7
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 7 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.1% 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.3% accurate, 1.0× speedup?

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

\\
x + \frac{x}{\frac{z}{y}}
\end{array}
Derivation
  1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \frac{y}{z} + x} \]
  7. Step-by-step derivation
    1. clear-num97.2%

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

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

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} + x \]
  9. Final simplification97.6%

    \[\leadsto x + \frac{x}{\frac{z}{y}} \]
  10. Add Preprocessing

Alternative 2: 69.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+43}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+29}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.70000000000000006e43 or 1.79999999999999988e29 < z

    1. Initial program 67.7%

      \[\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. Taylor expanded in y around 0 76.0%

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

    if -1.70000000000000006e43 < z < 1.79999999999999988e29

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 72.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+28}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.09999999999999993e28 or 1.4000000000000001e25 < z

    1. Initial program 68.7%

      \[\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. Taylor expanded in y around 0 75.3%

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

    if -1.09999999999999993e28 < z < 1.4000000000000001e25

    1. Initial program 95.0%

      \[\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
    5. Taylor expanded in y around inf 78.0%

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

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

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

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

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

Alternative 4: 70.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+40}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+28}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.00000000000000006e40 or 3.5999999999999999e28 < z

    1. Initial program 67.7%

      \[\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. Taylor expanded in y around 0 76.0%

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

    if -2.00000000000000006e40 < z < 3.5999999999999999e28

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} + x \]
    7. Applied egg-rr75.2%

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

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

Alternative 5: 72.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+46}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.9e46 or 7.7999999999999997e28 < z

    1. Initial program 67.7%

      \[\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. Taylor expanded in y around 0 76.0%

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

    if -1.9e46 < z < 7.7999999999999997e28

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 50.6% accurate, 7.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
	return x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x
end function
public static double code(double x, double y, double z) {
	return x;
}
def code(x, y, z):
	return x
function code(x, y, z)
	return x
end
function tmp = code(x, y, z)
	tmp = x;
end
code[x_, y_, z_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification47.1%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 96.3% 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 2024052 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (/ x (/ z (+ y z)))

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