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

Percentage Accurate: 87.8% → 99.9%
Time: 7.1s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 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 83.0%

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

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

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

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

      \[\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: 76.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+288} \lor \neg \left(x \leq 6.2 \cdot 10^{+186}\right) \land x \leq 9 \cdot 10^{+265}:\\ \;\;\;\;x \cdot \frac{-y}{z}\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.6e+288) (and (not (<= x 6.2e+186)) (<= x 9e+265)))
   (* x (/ (- y) z))
   (+ y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.6e+288) || (!(x <= 6.2e+186) && (x <= 9e+265))) {
		tmp = 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 ((x <= (-1.6d+288)) .or. (.not. (x <= 6.2d+186)) .and. (x <= 9d+265)) then
        tmp = 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 ((x <= -1.6e+288) || (!(x <= 6.2e+186) && (x <= 9e+265))) {
		tmp = x * (-y / z);
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.6e+288) or (not (x <= 6.2e+186) and (x <= 9e+265)):
		tmp = x * (-y / z)
	else:
		tmp = y + (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.6e+288) || (!(x <= 6.2e+186) && (x <= 9e+265)))
		tmp = Float64(x * Float64(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 ((x <= -1.6e+288) || (~((x <= 6.2e+186)) && (x <= 9e+265)))
		tmp = x * (-y / z);
	else
		tmp = y + (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.6e+288], And[N[Not[LessEqual[x, 6.2e+186]], $MachinePrecision], LessEqual[x, 9e+265]]], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+288} \lor \neg \left(x \leq 6.2 \cdot 10^{+186}\right) \land x \leq 9 \cdot 10^{+265}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.6000000000000001e288 or 6.2000000000000002e186 < x < 8.9999999999999997e265

    1. Initial program 74.6%

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

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

        \[\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)} \]
    5. Taylor expanded in z around 0 65.9%

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

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

        \[\leadsto -\color{blue}{x \cdot \frac{y}{z}} \]
      3. distribute-rgt-neg-in86.8%

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

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

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

    if -1.6000000000000001e288 < x < 6.2000000000000002e186 or 8.9999999999999997e265 < x

    1. Initial program 83.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+288} \lor \neg \left(x \leq 6.2 \cdot 10^{+186}\right) \land x \leq 9 \cdot 10^{+265}:\\ \;\;\;\;x \cdot \frac{-y}{z}\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \]

Alternative 3: 98.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.59999999999999985e31 or 1 < y

    1. Initial program 66.9%

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

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

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

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

        \[\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 inf 99.9%

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

    if -6.59999999999999985e31 < y < 1

    1. Initial program 99.9%

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

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

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

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

Alternative 4: 98.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+31}:\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\

\mathbf{elif}\;y \leq 1:\\
\;\;\;\;y + \frac{x}{z}\\

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


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

    1. Initial program 72.8%

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

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

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

        \[\leadsto \color{blue}{y - \frac{x \cdot \left(y - 1\right)}{z}} \]
      3. associate-/l*94.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 inf 100.0%

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

    if -6.59999999999999985e31 < y < 1

    1. Initial program 99.9%

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

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

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

    if 1 < y

    1. Initial program 60.9%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Taylor expanded in y around inf 60.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}}} \]
    4. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+31}:\\ \;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{z - x}}\\ \end{array} \]

Alternative 5: 97.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 72.8%

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

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

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

        \[\leadsto \color{blue}{y - \frac{x \cdot \left(y - 1\right)}{z}} \]
      3. associate-/l*94.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 inf 100.0%

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

    if -1.00000000000000005e32 < y

    1. Initial program 86.5%

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

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

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

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

        \[\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 x around 0 94.0%

      \[\leadsto y - \color{blue}{\frac{x \cdot \left(y - 1\right)}{z}} \]
    6. Step-by-step derivation
      1. sub-neg94.0%

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

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

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

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

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

Alternative 6: 76.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.55 \cdot 10^{+286} \lor \neg \left(x \leq 4.4 \cdot 10^{+186}\right):\\ \;\;\;\;\frac{y}{\frac{-z}{x}}\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.55e+286) (not (<= x 4.4e+186)))
   (/ y (/ (- z) x))
   (+ y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.55e+286) || !(x <= 4.4e+186)) {
		tmp = y / (-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 ((x <= (-1.55d+286)) .or. (.not. (x <= 4.4d+186))) then
        tmp = y / (-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 ((x <= -1.55e+286) || !(x <= 4.4e+186)) {
		tmp = y / (-z / x);
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.55e+286) or not (x <= 4.4e+186):
		tmp = y / (-z / x)
	else:
		tmp = y + (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.55e+286) || !(x <= 4.4e+186))
		tmp = Float64(y / Float64(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 ((x <= -1.55e+286) || ~((x <= 4.4e+186)))
		tmp = y / (-z / x);
	else
		tmp = y + (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.55e+286], N[Not[LessEqual[x, 4.4e+186]], $MachinePrecision]], N[(y / N[((-z) / x), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+286} \lor \neg \left(x \leq 4.4 \cdot 10^{+186}\right):\\
\;\;\;\;\frac{y}{\frac{-z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.54999999999999996e286 or 4.3999999999999997e186 < x

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-\left(-y\right)\right) \cdot x}}{-z} \]
      5. remove-double-neg55.3%

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

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

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

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

    if -1.54999999999999996e286 < x < 4.3999999999999997e186

    1. Initial program 83.3%

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

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

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

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

Alternative 7: 76.4% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.1999999999999999e286

    1. Initial program 65.7%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{x \cdot \frac{y}{z}} \]
      3. distribute-rgt-neg-in99.8%

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

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

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

    if -3.1999999999999999e286 < x < 5.2000000000000001e186

    1. Initial program 83.3%

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

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

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

    if 5.2000000000000001e186 < x

    1. Initial program 85.4%

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{x \cdot \frac{y}{z}} \]
      3. distribute-rgt-neg-in62.8%

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{z} \cdot y} \]
      3. distribute-lft-neg-in66.4%

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-x}{z}} \]
    10. Simplified66.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.2 \cdot 10^{+286}:\\ \;\;\;\;x \cdot \frac{-y}{z}\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+186}:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\ \end{array} \]

Alternative 8: 59.8% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 0.000155:\\
\;\;\;\;\frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.2e-22 or 1.55e-4 < y

    1. Initial program 69.4%

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

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

    if -5.2e-22 < y < 1.55e-4

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{-22}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 0.000155:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 9: 77.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 83.0%

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

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

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

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

Alternative 10: 40.4% 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 83.0%

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

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

    \[\leadsto y \]

Developer target: 93.6% 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 2023300 
(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))