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

Percentage Accurate: 88.3% → 99.6%
Time: 8.7s
Alternatives: 11
Speedup: 0.8×

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: 88.3% 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.6% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.1e22 or 1.50000000000000008e-77 < z

    1. Initial program 74.8%

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

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

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

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

        \[\leadsto \color{blue}{y - \frac{y \cdot x + -1 \cdot x}{z}} \]
      3. distribute-rgt-out92.1%

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

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

        \[\leadsto y - \color{blue}{\frac{x}{1} \cdot \frac{y + -1}{z}} \]
      6. /-rgt-identity99.9%

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

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

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

    if -1.1e22 < z < 1.50000000000000008e-77

    1. Initial program 99.9%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

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

Alternative 2: 99.2% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.02e155 or 2.2e8 < y

    1. Initial program 72.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - x}{\frac{z}{y}}} \]
    5. Step-by-step derivation
      1. associate-/r/99.9%

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

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

    if -1.02e155 < y < 2.2e8

    1. Initial program 96.2%

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

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

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

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

        \[\leadsto \color{blue}{y - \frac{y \cdot x + -1 \cdot x}{z}} \]
      3. distribute-rgt-out99.3%

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

        \[\leadsto y - \frac{x \cdot \left(y + -1\right)}{\color{blue}{1 \cdot z}} \]
      5. times-frac99.8%

        \[\leadsto y - \color{blue}{\frac{x}{1} \cdot \frac{y + -1}{z}} \]
      6. /-rgt-identity99.8%

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

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

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

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

Alternative 3: 84.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.95999999999999996 or 1.04e139 < x

    1. Initial program 87.7%

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

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

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

        \[\leadsto \color{blue}{\frac{1 + -1 \cdot y}{z} \cdot x} \]
      3. mul-1-neg86.6%

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

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

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

    if -0.95999999999999996 < x < 1.04e139

    1. Initial program 86.6%

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

      \[\leadsto \frac{x + \color{blue}{y \cdot z}}{z} \]
    3. Taylor expanded in x around 0 86.8%

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

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

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

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

Alternative 4: 98.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 74.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - x}{\frac{z}{y}}} \]
    5. Step-by-step derivation
      1. associate-/r/99.0%

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

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

    if -2.4e15 < y < 1

    1. Initial program 99.9%

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

      \[\leadsto \frac{x + \color{blue}{y \cdot z}}{z} \]
    3. Taylor expanded in x around 0 99.3%

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

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

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

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

Alternative 5: 97.7% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 93.3%

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

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

    if 2.2e8 < y

    1. Initial program 70.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{z - x}{\frac{z}{y}}} \]
    5. Step-by-step derivation
      1. associate-/r/99.9%

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

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

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

Alternative 6: 77.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 7 \cdot 10^{+270}:\\
\;\;\;\;y + \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 6.9999999999999999e270

    1. Initial program 87.3%

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

      \[\leadsto \frac{x + \color{blue}{y \cdot z}}{z} \]
    3. Taylor expanded in x around 0 77.8%

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

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

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

    if 6.9999999999999999e270 < x

    1. Initial program 80.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. *-commutative60.9%

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

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

      \[\leadsto \color{blue}{\frac{z - x}{\frac{z}{y}}} \]
    5. Step-by-step derivation
      1. associate-/r/79.7%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.4 \cdot 10^{+268}:\\
\;\;\;\;y + \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.40000000000000022e268

    1. Initial program 87.3%

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

      \[\leadsto \frac{x + \color{blue}{y \cdot z}}{z} \]
    3. Taylor expanded in x around 0 77.8%

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

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

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

    if 5.40000000000000022e268 < x

    1. Initial program 80.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. *-commutative60.9%

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

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

      \[\leadsto \color{blue}{\frac{z - x}{\frac{z}{y}}} \]
    5. Step-by-step derivation
      1. associate-/r/79.7%

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

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

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

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

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

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

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

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

Alternative 8: 60.1% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0005:\\
\;\;\;\;y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.0000000000000001e-4 or 1.64999999999999998e-52 < y

    1. Initial program 76.5%

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

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

    if -5.0000000000000001e-4 < y < 1.64999999999999998e-52

    1. Initial program 99.9%

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

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

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

Alternative 9: 61.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00048:\\
\;\;\;\;z \cdot \frac{y}{z}\\

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

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


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

    1. Initial program 79.8%

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

      \[\leadsto \frac{x + \color{blue}{y \cdot z}}{z} \]
    3. Taylor expanded in x around 0 34.4%

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

        \[\leadsto \frac{\color{blue}{z \cdot y}}{z} \]
    5. Simplified34.4%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{z}{y}}} \]
      2. div-inv51.8%

        \[\leadsto \color{blue}{z \cdot \frac{1}{\frac{z}{y}}} \]
      3. clear-num51.9%

        \[\leadsto z \cdot \color{blue}{\frac{y}{z}} \]
    7. Applied egg-rr51.9%

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

    if -4.80000000000000012e-4 < y < 3.29999999999999995e-52

    1. Initial program 99.9%

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

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

    if 3.29999999999999995e-52 < y

    1. Initial program 74.1%

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

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

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

Alternative 10: 77.5% 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 87.1%

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

    \[\leadsto \frac{x + \color{blue}{y \cdot z}}{z} \]
  3. Taylor expanded in x around 0 76.1%

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

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

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

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

Alternative 11: 40.7% 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 87.1%

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

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

    \[\leadsto y \]

Developer target: 94.0% 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 2023238 
(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))