Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3

Percentage Accurate: 87.8% → 99.9%
Time: 6.5s
Alternatives: 11
Speedup: 1.0×

Specification

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

\\
\frac{x + y \cdot \left(z - x\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 11 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: 87.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

    \[\frac{x + y \cdot \left(z - x\right)}{z} \]
  2. Taylor expanded in x around -inf 96.6%

    \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
  3. Step-by-step derivation
    1. mul-1-neg96.6%

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

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

      \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
    4. associate-/r/99.9%

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

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

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

    \[\leadsto \color{blue}{y - \frac{x}{z} \cdot \left(y + -1\right)} \]
  5. Final simplification99.9%

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

Alternative 2: 79.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 7400000000:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+74} \lor \neg \left(y \leq 2.26 \cdot 10^{+108}\right) \land y \leq 1.7 \cdot 10^{+209}:\\ \;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;y - \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 7400000000.0)
   (+ y (/ x z))
   (if (or (<= y 9e+74) (and (not (<= y 2.26e+108)) (<= y 1.7e+209)))
     (* (/ x z) (- y))
     (- y (/ x z)))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 7400000000.0) {
		tmp = y + (x / z);
	} else if ((y <= 9e+74) || (!(y <= 2.26e+108) && (y <= 1.7e+209))) {
		tmp = (x / z) * -y;
	} else {
		tmp = y - (x / z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= 7400000000.0d0) then
        tmp = y + (x / z)
    else if ((y <= 9d+74) .or. (.not. (y <= 2.26d+108)) .and. (y <= 1.7d+209)) then
        tmp = (x / z) * -y
    else
        tmp = y - (x / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 7400000000.0) {
		tmp = y + (x / z);
	} else if ((y <= 9e+74) || (!(y <= 2.26e+108) && (y <= 1.7e+209))) {
		tmp = (x / z) * -y;
	} else {
		tmp = y - (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 7400000000.0:
		tmp = y + (x / z)
	elif (y <= 9e+74) or (not (y <= 2.26e+108) and (y <= 1.7e+209)):
		tmp = (x / z) * -y
	else:
		tmp = y - (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 7400000000.0)
		tmp = Float64(y + Float64(x / z));
	elseif ((y <= 9e+74) || (!(y <= 2.26e+108) && (y <= 1.7e+209)))
		tmp = Float64(Float64(x / z) * Float64(-y));
	else
		tmp = Float64(y - Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 7400000000.0)
		tmp = y + (x / z);
	elseif ((y <= 9e+74) || (~((y <= 2.26e+108)) && (y <= 1.7e+209)))
		tmp = (x / z) * -y;
	else
		tmp = y - (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 7400000000.0], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 9e+74], And[N[Not[LessEqual[y, 2.26e+108]], $MachinePrecision], LessEqual[y, 1.7e+209]]], N[(N[(x / z), $MachinePrecision] * (-y)), $MachinePrecision], N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 7400000000:\\
\;\;\;\;y + \frac{x}{z}\\

\mathbf{elif}\;y \leq 9 \cdot 10^{+74} \lor \neg \left(y \leq 2.26 \cdot 10^{+108}\right) \land y \leq 1.7 \cdot 10^{+209}:\\
\;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\

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


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

    1. Initial program 94.2%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 98.9%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg98.9%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/100.0%

        \[\leadsto y - \color{blue}{\frac{x}{z} \cdot \left(y - 1\right)} \]
      5. sub-neg100.0%

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

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

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

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

        \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
      2. distribute-frac-neg86.6%

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified86.6%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Taylor expanded in y around 0 86.6%

      \[\leadsto \color{blue}{y + \frac{x}{z}} \]
    9. Step-by-step derivation
      1. +-commutative86.6%

        \[\leadsto \color{blue}{\frac{x}{z} + y} \]
    10. Simplified86.6%

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

    if 7.4e9 < y < 8.9999999999999999e74 or 2.2599999999999999e108 < y < 1.6999999999999998e209

    1. Initial program 91.1%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around inf 90.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - x}}} \]
      2. associate-/r/88.1%

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

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

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

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

        \[\leadsto -\frac{\color{blue}{y \cdot x}}{z} \]
      3. associate-*r/71.7%

        \[\leadsto -\color{blue}{y \cdot \frac{x}{z}} \]
      4. distribute-rgt-neg-out71.7%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{x}{z}\right)} \]
      5. distribute-frac-neg71.7%

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

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

    if 8.9999999999999999e74 < y < 2.2599999999999999e108 or 1.6999999999999998e209 < y

    1. Initial program 68.1%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 85.0%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg85.0%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/100.0%

        \[\leadsto y - \color{blue}{\frac{x}{z} \cdot \left(y - 1\right)} \]
      5. sub-neg100.0%

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot \frac{x}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg61.5%

        \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
      2. distribute-frac-neg61.5%

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified61.5%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Step-by-step derivation
      1. add-log-exp10.5%

        \[\leadsto \color{blue}{\log \left(e^{y}\right)} - \frac{-x}{z} \]
      2. log1p-expm1-u4.1%

        \[\leadsto \log \left(e^{y}\right) - \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{-x}{z}\right)\right)} \]
      3. log1p-udef4.1%

        \[\leadsto \log \left(e^{y}\right) - \color{blue}{\log \left(1 + \mathsf{expm1}\left(\frac{-x}{z}\right)\right)} \]
      4. diff-log4.1%

        \[\leadsto \color{blue}{\log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{-x}{z}\right)}\right)} \]
      5. add-sqr-sqrt2.2%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{z}\right)}\right) \]
      6. sqrt-unprod13.2%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{z}\right)}\right) \]
      7. sqr-neg13.2%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{z}\right)}\right) \]
      8. sqrt-unprod11.3%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z}\right)}\right) \]
      9. add-sqr-sqrt19.9%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{x}}{z}\right)}\right) \]
    9. Applied egg-rr19.9%

      \[\leadsto \color{blue}{\log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{x}{z}\right)}\right)} \]
    10. Step-by-step derivation
      1. log-div19.9%

        \[\leadsto \color{blue}{\log \left(e^{y}\right) - \log \left(1 + \mathsf{expm1}\left(\frac{x}{z}\right)\right)} \]
      2. rem-log-exp89.6%

        \[\leadsto \color{blue}{y} - \log \left(1 + \mathsf{expm1}\left(\frac{x}{z}\right)\right) \]
      3. log1p-def89.6%

        \[\leadsto y - \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{z}\right)\right)} \]
      4. log1p-expm174.5%

        \[\leadsto y - \color{blue}{\frac{x}{z}} \]
    11. Simplified74.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 7400000000:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+74} \lor \neg \left(y \leq 2.26 \cdot 10^{+108}\right) \land y \leq 1.7 \cdot 10^{+209}:\\ \;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;y - \frac{x}{z}\\ \end{array} \]

Alternative 3: 79.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 780000000:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+75}:\\ \;\;\;\;\frac{y \cdot \left(-x\right)}{z}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+107} \lor \neg \left(y \leq 1.05 \cdot 10^{+201}\right):\\ \;\;\;\;y - \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 780000000.0)
   (+ y (/ x z))
   (if (<= y 1.2e+75)
     (/ (* y (- x)) z)
     (if (or (<= y 5.2e+107) (not (<= y 1.05e+201)))
       (- y (/ x z))
       (* (/ x z) (- y))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 780000000.0) {
		tmp = y + (x / z);
	} else if (y <= 1.2e+75) {
		tmp = (y * -x) / z;
	} else if ((y <= 5.2e+107) || !(y <= 1.05e+201)) {
		tmp = y - (x / z);
	} else {
		tmp = (x / z) * -y;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= 780000000.0d0) then
        tmp = y + (x / z)
    else if (y <= 1.2d+75) then
        tmp = (y * -x) / z
    else if ((y <= 5.2d+107) .or. (.not. (y <= 1.05d+201))) then
        tmp = y - (x / z)
    else
        tmp = (x / z) * -y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 780000000.0) {
		tmp = y + (x / z);
	} else if (y <= 1.2e+75) {
		tmp = (y * -x) / z;
	} else if ((y <= 5.2e+107) || !(y <= 1.05e+201)) {
		tmp = y - (x / z);
	} else {
		tmp = (x / z) * -y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 780000000.0:
		tmp = y + (x / z)
	elif y <= 1.2e+75:
		tmp = (y * -x) / z
	elif (y <= 5.2e+107) or not (y <= 1.05e+201):
		tmp = y - (x / z)
	else:
		tmp = (x / z) * -y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 780000000.0)
		tmp = Float64(y + Float64(x / z));
	elseif (y <= 1.2e+75)
		tmp = Float64(Float64(y * Float64(-x)) / z);
	elseif ((y <= 5.2e+107) || !(y <= 1.05e+201))
		tmp = Float64(y - Float64(x / z));
	else
		tmp = Float64(Float64(x / z) * Float64(-y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 780000000.0)
		tmp = y + (x / z);
	elseif (y <= 1.2e+75)
		tmp = (y * -x) / z;
	elseif ((y <= 5.2e+107) || ~((y <= 1.05e+201)))
		tmp = y - (x / z);
	else
		tmp = (x / z) * -y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 780000000.0], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+75], N[(N[(y * (-x)), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[y, 5.2e+107], N[Not[LessEqual[y, 1.05e+201]], $MachinePrecision]], N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * (-y)), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 780000000:\\
\;\;\;\;y + \frac{x}{z}\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{+75}:\\
\;\;\;\;\frac{y \cdot \left(-x\right)}{z}\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+107} \lor \neg \left(y \leq 1.05 \cdot 10^{+201}\right):\\
\;\;\;\;y - \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 7.8e8

    1. Initial program 94.2%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 98.9%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg98.9%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/100.0%

        \[\leadsto y - \color{blue}{\frac{x}{z} \cdot \left(y - 1\right)} \]
      5. sub-neg100.0%

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

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

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

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

        \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
      2. distribute-frac-neg86.6%

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified86.6%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Taylor expanded in y around 0 86.6%

      \[\leadsto \color{blue}{y + \frac{x}{z}} \]
    9. Step-by-step derivation
      1. +-commutative86.6%

        \[\leadsto \color{blue}{\frac{x}{z} + y} \]
    10. Simplified86.6%

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

    if 7.8e8 < y < 1.2e75

    1. Initial program 99.8%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around inf 97.9%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot y\right)}}{z} \]
    4. Step-by-step derivation
      1. mul-1-neg78.9%

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{z} \]
      2. distribute-lft-neg-out78.9%

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

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

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

    if 1.2e75 < y < 5.2000000000000002e107 or 1.05e201 < y

    1. Initial program 68.1%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 85.0%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg85.0%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/100.0%

        \[\leadsto y - \color{blue}{\frac{x}{z} \cdot \left(y - 1\right)} \]
      5. sub-neg100.0%

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot \frac{x}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg61.5%

        \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
      2. distribute-frac-neg61.5%

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified61.5%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Step-by-step derivation
      1. add-log-exp10.5%

        \[\leadsto \color{blue}{\log \left(e^{y}\right)} - \frac{-x}{z} \]
      2. log1p-expm1-u4.1%

        \[\leadsto \log \left(e^{y}\right) - \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{-x}{z}\right)\right)} \]
      3. log1p-udef4.1%

        \[\leadsto \log \left(e^{y}\right) - \color{blue}{\log \left(1 + \mathsf{expm1}\left(\frac{-x}{z}\right)\right)} \]
      4. diff-log4.1%

        \[\leadsto \color{blue}{\log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{-x}{z}\right)}\right)} \]
      5. add-sqr-sqrt2.2%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{z}\right)}\right) \]
      6. sqrt-unprod13.2%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{z}\right)}\right) \]
      7. sqr-neg13.2%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{z}\right)}\right) \]
      8. sqrt-unprod11.3%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z}\right)}\right) \]
      9. add-sqr-sqrt19.9%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{x}}{z}\right)}\right) \]
    9. Applied egg-rr19.9%

      \[\leadsto \color{blue}{\log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{x}{z}\right)}\right)} \]
    10. Step-by-step derivation
      1. log-div19.9%

        \[\leadsto \color{blue}{\log \left(e^{y}\right) - \log \left(1 + \mathsf{expm1}\left(\frac{x}{z}\right)\right)} \]
      2. rem-log-exp89.6%

        \[\leadsto \color{blue}{y} - \log \left(1 + \mathsf{expm1}\left(\frac{x}{z}\right)\right) \]
      3. log1p-def89.6%

        \[\leadsto y - \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{z}\right)\right)} \]
      4. log1p-expm174.5%

        \[\leadsto y - \color{blue}{\frac{x}{z}} \]
    11. Simplified74.5%

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

    if 5.2000000000000002e107 < y < 1.05e201

    1. Initial program 85.9%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around inf 85.9%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - x}}} \]
      2. associate-/r/85.8%

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

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

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

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

        \[\leadsto -\frac{\color{blue}{y \cdot x}}{z} \]
      3. associate-*r/67.5%

        \[\leadsto -\color{blue}{y \cdot \frac{x}{z}} \]
      4. distribute-rgt-neg-out67.5%

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

        \[\leadsto y \cdot \color{blue}{\frac{-x}{z}} \]
    7. Simplified67.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 780000000:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+75}:\\ \;\;\;\;\frac{y \cdot \left(-x\right)}{z}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+107} \lor \neg \left(y \leq 1.05 \cdot 10^{+201}\right):\\ \;\;\;\;y - \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\ \end{array} \]

Alternative 4: 85.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-9} \lor \neg \left(x \leq 6.4 \cdot 10^{+25}\right):\\ \;\;\;\;\frac{x}{z} \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -2.2e-9) (not (<= x 6.4e+25)))
   (* (/ x z) (- 1.0 y))
   (+ y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -2.2e-9) || !(x <= 6.4e+25)) {
		tmp = (x / z) * (1.0 - y);
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-2.2d-9)) .or. (.not. (x <= 6.4d+25))) then
        tmp = (x / z) * (1.0d0 - y)
    else
        tmp = y + (x / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -2.2e-9) || !(x <= 6.4e+25)) {
		tmp = (x / z) * (1.0 - y);
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -2.2e-9) or not (x <= 6.4e+25):
		tmp = (x / z) * (1.0 - y)
	else:
		tmp = y + (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -2.2e-9) || !(x <= 6.4e+25))
		tmp = Float64(Float64(x / z) * Float64(1.0 - y));
	else
		tmp = Float64(y + Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -2.2e-9) || ~((x <= 6.4e+25)))
		tmp = (x / z) * (1.0 - y);
	else
		tmp = y + (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.2e-9], N[Not[LessEqual[x, 6.4e+25]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-9} \lor \neg \left(x \leq 6.4 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x}{z} \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1999999999999998e-9 or 6.3999999999999999e25 < x

    1. Initial program 93.4%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around inf 86.7%

      \[\leadsto \color{blue}{\frac{x \cdot \left(1 + -1 \cdot y\right)}{z}} \]
    3. Step-by-step derivation
      1. associate-/l*89.6%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{1 + -1 \cdot y}}} \]
      2. associate-/r/89.6%

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

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

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

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

    if -2.1999999999999998e-9 < x < 6.3999999999999999e25

    1. Initial program 87.4%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 99.1%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg99.1%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/100.0%

        \[\leadsto y - \color{blue}{\frac{x}{z} \cdot \left(y - 1\right)} \]
      5. sub-neg100.0%

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot \frac{x}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg84.5%

        \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
      2. distribute-frac-neg84.5%

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified84.5%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Taylor expanded in y around 0 84.5%

      \[\leadsto \color{blue}{y + \frac{x}{z}} \]
    9. Step-by-step derivation
      1. +-commutative84.5%

        \[\leadsto \color{blue}{\frac{x}{z} + y} \]
    10. Simplified84.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-9} \lor \neg \left(x \leq 6.4 \cdot 10^{+25}\right):\\ \;\;\;\;\frac{x}{z} \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \]

Alternative 5: 95.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -15000000 \lor \neg \left(y \leq 2.2 \cdot 10^{-5}\right):\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -15000000.0) (not (<= y 2.2e-5)))
   (* (- z x) (/ y z))
   (+ y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -15000000.0) || !(y <= 2.2e-5)) {
		tmp = (z - x) * (y / z);
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-15000000.0d0)) .or. (.not. (y <= 2.2d-5))) then
        tmp = (z - x) * (y / z)
    else
        tmp = y + (x / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -15000000.0) || !(y <= 2.2e-5)) {
		tmp = (z - x) * (y / z);
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -15000000.0) or not (y <= 2.2e-5):
		tmp = (z - x) * (y / z)
	else:
		tmp = y + (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -15000000.0) || !(y <= 2.2e-5))
		tmp = Float64(Float64(z - x) * Float64(y / z));
	else
		tmp = Float64(y + Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -15000000.0) || ~((y <= 2.2e-5)))
		tmp = (z - x) * (y / z);
	else
		tmp = y + (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -15000000.0], N[Not[LessEqual[y, 2.2e-5]], $MachinePrecision]], N[(N[(z - x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -15000000 \lor \neg \left(y \leq 2.2 \cdot 10^{-5}\right):\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.5e7 or 2.1999999999999999e-5 < y

    1. Initial program 82.1%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around inf 81.9%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - x}}} \]
      2. associate-/r/90.7%

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

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

    if -1.5e7 < y < 2.1999999999999999e-5

    1. Initial program 99.9%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 100.0%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg100.0%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/100.0%

        \[\leadsto y - \color{blue}{\frac{x}{z} \cdot \left(y - 1\right)} \]
      5. sub-neg100.0%

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot \frac{x}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg99.5%

        \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
      2. distribute-frac-neg99.5%

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified99.5%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Taylor expanded in y around 0 99.5%

      \[\leadsto \color{blue}{y + \frac{x}{z}} \]
    9. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{x}{z} + y} \]
    10. Simplified99.5%

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

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

Alternative 6: 98.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -15000000 \lor \neg \left(y \leq 2.2 \cdot 10^{-5}\right):\\ \;\;\;\;\frac{y}{\frac{z}{z - x}}\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -15000000.0) (not (<= y 2.2e-5)))
   (/ y (/ z (- z x)))
   (+ y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -15000000.0) || !(y <= 2.2e-5)) {
		tmp = y / (z / (z - x));
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-15000000.0d0)) .or. (.not. (y <= 2.2d-5))) then
        tmp = y / (z / (z - x))
    else
        tmp = y + (x / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -15000000.0) || !(y <= 2.2e-5)) {
		tmp = y / (z / (z - x));
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -15000000.0) or not (y <= 2.2e-5):
		tmp = y / (z / (z - x))
	else:
		tmp = y + (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -15000000.0) || !(y <= 2.2e-5))
		tmp = Float64(y / Float64(z / Float64(z - x)));
	else
		tmp = Float64(y + Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -15000000.0) || ~((y <= 2.2e-5)))
		tmp = y / (z / (z - x));
	else
		tmp = y + (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -15000000.0], N[Not[LessEqual[y, 2.2e-5]], $MachinePrecision]], N[(y / N[(z / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -15000000 \lor \neg \left(y \leq 2.2 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{y}{\frac{z}{z - x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.5e7 or 2.1999999999999999e-5 < y

    1. Initial program 82.1%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around inf 81.9%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - x}}} \]
    4. Simplified99.6%

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

    if -1.5e7 < y < 2.1999999999999999e-5

    1. Initial program 99.9%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 100.0%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg100.0%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/100.0%

        \[\leadsto y - \color{blue}{\frac{x}{z} \cdot \left(y - 1\right)} \]
      5. sub-neg100.0%

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

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

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

      \[\leadsto y - \color{blue}{-1 \cdot \frac{x}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg99.5%

        \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
      2. distribute-frac-neg99.5%

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified99.5%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Taylor expanded in y around 0 99.5%

      \[\leadsto \color{blue}{y + \frac{x}{z}} \]
    9. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{x}{z} + y} \]
    10. Simplified99.5%

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

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

Alternative 7: 61.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{-69} \lor \neg \left(y \leq 3.4 \cdot 10^{-6}\right):\\ \;\;\;\;z \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -4.4e-69) (not (<= y 3.4e-6))) (* z (/ y z)) (/ x z)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -4.4e-69) || !(y <= 3.4e-6)) {
		tmp = z * (y / z);
	} else {
		tmp = x / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-4.4d-69)) .or. (.not. (y <= 3.4d-6))) then
        tmp = z * (y / z)
    else
        tmp = x / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -4.4e-69) || !(y <= 3.4e-6)) {
		tmp = z * (y / z);
	} else {
		tmp = x / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -4.4e-69) or not (y <= 3.4e-6):
		tmp = z * (y / z)
	else:
		tmp = x / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -4.4e-69) || !(y <= 3.4e-6))
		tmp = Float64(z * Float64(y / z));
	else
		tmp = Float64(x / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -4.4e-69) || ~((y <= 3.4e-6)))
		tmp = z * (y / z);
	else
		tmp = x / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.4e-69], N[Not[LessEqual[y, 3.4e-6]], $MachinePrecision]], N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-69} \lor \neg \left(y \leq 3.4 \cdot 10^{-6}\right):\\
\;\;\;\;z \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.4e-69 or 3.40000000000000006e-6 < y

    1. Initial program 84.0%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around inf 83.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z}}} \]
      2. associate-/r/52.5%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot z} \]
    5. Applied egg-rr52.5%

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

    if -4.4e-69 < y < 3.40000000000000006e-6

    1. Initial program 99.9%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around 0 80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{-69} \lor \neg \left(y \leq 3.4 \cdot 10^{-6}\right):\\ \;\;\;\;z \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 8: 60.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{-69}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -6.5e-69) y (if (<= y 7.4e-8) (/ x z) y)))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -6.5e-69) {
		tmp = y;
	} else if (y <= 7.4e-8) {
		tmp = x / z;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-6.5d-69)) then
        tmp = y
    else if (y <= 7.4d-8) then
        tmp = x / z
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -6.5e-69) {
		tmp = y;
	} else if (y <= 7.4e-8) {
		tmp = x / z;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -6.5e-69:
		tmp = y
	elif y <= 7.4e-8:
		tmp = x / z
	else:
		tmp = y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -6.5e-69)
		tmp = y;
	elseif (y <= 7.4e-8)
		tmp = Float64(x / z);
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -6.5e-69)
		tmp = y;
	elseif (y <= 7.4e-8)
		tmp = x / z;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -6.5e-69], y, If[LessEqual[y, 7.4e-8], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-69}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 7.4 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.49999999999999951e-69 or 7.4000000000000001e-8 < y

    1. Initial program 84.0%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around 0 49.2%

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

    if -6.49999999999999951e-69 < y < 7.4000000000000001e-8

    1. Initial program 99.9%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around 0 80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{-69}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-8}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 9: 81.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{-5}:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y - \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 2.2e-5) (+ y (/ x z)) (- y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.2e-5) {
		tmp = y + (x / z);
	} else {
		tmp = y - (x / z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= 2.2d-5) then
        tmp = y + (x / z)
    else
        tmp = y - (x / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.2e-5) {
		tmp = y + (x / z);
	} else {
		tmp = y - (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 2.2e-5:
		tmp = y + (x / z)
	else:
		tmp = y - (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 2.2e-5)
		tmp = Float64(y + Float64(x / z));
	else
		tmp = Float64(y - Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 2.2e-5)
		tmp = y + (x / z);
	else
		tmp = y - (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 2.2e-5], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.1999999999999999e-5

    1. Initial program 94.1%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 98.8%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg98.8%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/100.0%

        \[\leadsto y - \color{blue}{\frac{x}{z} \cdot \left(y - 1\right)} \]
      5. sub-neg100.0%

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

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

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

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

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

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified86.4%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Taylor expanded in y around 0 86.4%

      \[\leadsto \color{blue}{y + \frac{x}{z}} \]
    9. Step-by-step derivation
      1. +-commutative86.4%

        \[\leadsto \color{blue}{\frac{x}{z} + y} \]
    10. Simplified86.4%

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

    if 2.1999999999999999e-5 < y

    1. Initial program 81.9%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in x around -inf 91.4%

      \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg91.4%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
      4. associate-/r/99.9%

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

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

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

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

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

        \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
      2. distribute-frac-neg42.6%

        \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    7. Simplified42.6%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
    8. Step-by-step derivation
      1. add-log-exp14.2%

        \[\leadsto \color{blue}{\log \left(e^{y}\right)} - \frac{-x}{z} \]
      2. log1p-expm1-u4.6%

        \[\leadsto \log \left(e^{y}\right) - \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{-x}{z}\right)\right)} \]
      3. log1p-udef4.6%

        \[\leadsto \log \left(e^{y}\right) - \color{blue}{\log \left(1 + \mathsf{expm1}\left(\frac{-x}{z}\right)\right)} \]
      4. diff-log4.6%

        \[\leadsto \color{blue}{\log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{-x}{z}\right)}\right)} \]
      5. add-sqr-sqrt1.2%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{z}\right)}\right) \]
      6. sqrt-unprod13.7%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{z}\right)}\right) \]
      7. sqr-neg13.7%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{z}\right)}\right) \]
      8. sqrt-unprod12.6%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z}\right)}\right) \]
      9. add-sqr-sqrt19.3%

        \[\leadsto \log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{\color{blue}{x}}{z}\right)}\right) \]
    9. Applied egg-rr19.3%

      \[\leadsto \color{blue}{\log \left(\frac{e^{y}}{1 + \mathsf{expm1}\left(\frac{x}{z}\right)}\right)} \]
    10. Step-by-step derivation
      1. log-div19.3%

        \[\leadsto \color{blue}{\log \left(e^{y}\right) - \log \left(1 + \mathsf{expm1}\left(\frac{x}{z}\right)\right)} \]
      2. rem-log-exp75.0%

        \[\leadsto \color{blue}{y} - \log \left(1 + \mathsf{expm1}\left(\frac{x}{z}\right)\right) \]
      3. log1p-def75.0%

        \[\leadsto y - \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{z}\right)\right)} \]
      4. log1p-expm158.0%

        \[\leadsto y - \color{blue}{\frac{x}{z}} \]
    11. Simplified58.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{-5}:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y - \frac{x}{z}\\ \end{array} \]

Alternative 10: 78.0% accurate, 1.8× speedup?

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

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

    \[\frac{x + y \cdot \left(z - x\right)}{z} \]
  2. Taylor expanded in x around -inf 96.6%

    \[\leadsto \color{blue}{y + -1 \cdot \frac{x \cdot \left(y - 1\right)}{z}} \]
  3. Step-by-step derivation
    1. mul-1-neg96.6%

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

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

      \[\leadsto y - \color{blue}{\frac{x}{\frac{z}{y - 1}}} \]
    4. associate-/r/99.9%

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

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

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

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

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

      \[\leadsto y - \color{blue}{\left(-\frac{x}{z}\right)} \]
    2. distribute-frac-neg73.0%

      \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
  7. Simplified73.0%

    \[\leadsto y - \color{blue}{\frac{-x}{z}} \]
  8. Taylor expanded in y around 0 73.0%

    \[\leadsto \color{blue}{y + \frac{x}{z}} \]
  9. Step-by-step derivation
    1. +-commutative73.0%

      \[\leadsto \color{blue}{\frac{x}{z} + y} \]
  10. Simplified73.0%

    \[\leadsto \color{blue}{\frac{x}{z} + y} \]
  11. Final simplification73.0%

    \[\leadsto y + \frac{x}{z} \]

Alternative 11: 41.3% accurate, 9.0× speedup?

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

\\
y
\end{array}
Derivation
  1. Initial program 90.4%

    \[\frac{x + y \cdot \left(z - x\right)}{z} \]
  2. Taylor expanded in x around 0 37.8%

    \[\leadsto \color{blue}{y} \]
  3. Final simplification37.8%

    \[\leadsto y \]

Developer target: 93.9% accurate, 0.8× speedup?

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

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

Reproduce

?
herbie shell --seed 2023271 
(FPCore (x y z)
  :name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
  :precision binary64

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

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