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

Percentage Accurate: 88.0% → 99.5%
Time: 10.4s
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.0% 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.5% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 88.8%

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

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

    if 5.4999999999999996e-270 < y < 1.56e16

    1. Initial program 99.9%

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

    if 1.56e16 < y

    1. Initial program 66.0%

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 76.2%

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

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

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

        \[\leadsto \color{blue}{y + -1 \cdot \frac{y \cdot x}{z}} \]
      2. mul-1-neg97.0%

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

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

        \[\leadsto \color{blue}{y - y \cdot \frac{x}{z}} \]
      5. *-commutative100.0%

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

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

    if -1.6999999999999999e31 < y < 8e14

    1. Initial program 99.9%

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

    if 8e14 < y

    1. Initial program 66.0%

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

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

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

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

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

Alternative 3: 99.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \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 -1.0) (not (<= y 1.0))) (* y (- 1.0 (/ x z))) (+ y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.0) || !(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 <= (-1.0d0)) .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 <= -1.0) || !(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 <= -1.0) 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 <= -1.0) || !(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 <= -1.0) || ~((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, -1.0], 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 -1 \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 < -1 or 1 < y

    1. Initial program 73.3%

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

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

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

    if -1 < y < 1

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \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: 99.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 78.0%

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

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

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

        \[\leadsto \color{blue}{y + -1 \cdot \frac{y \cdot x}{z}} \]
      2. mul-1-neg96.9%

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

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

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

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

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

    if -1 < y < 1

    1. Initial program 99.9%

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

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

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

    if 1 < y

    1. Initial program 68.2%

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

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

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

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

Alternative 5: 99.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;y - y \cdot \frac{x}{z}\\ \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 -1.0)
   (- y (* y (/ 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 <= -1.0) {
		tmp = y - (y * (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 <= (-1.0d0)) then
        tmp = y - (y * (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 <= -1.0) {
		tmp = y - (y * (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 <= -1.0:
		tmp = y - (y * (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 <= -1.0)
		tmp = Float64(y - Float64(y * 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 <= -1.0)
		tmp = y - (y * (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, -1.0], N[(y - N[(y * 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 -1:\\
\;\;\;\;y - y \cdot \frac{x}{z}\\

\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 < -1

    1. Initial program 78.0%

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

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

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

        \[\leadsto \color{blue}{y + -1 \cdot \frac{y \cdot x}{z}} \]
      2. mul-1-neg96.9%

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

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

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

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

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

    if -1 < y < 1

    1. Initial program 99.9%

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

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

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

    if 1 < y

    1. Initial program 68.2%

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

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

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

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

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

Alternative 6: 62.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-44} \lor \neg \left(y \leq 0.00042\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 < -8.19999999999999984e-44 or 4.2000000000000002e-4 < y

    1. Initial program 75.5%

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

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

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

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

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

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

    if -8.19999999999999984e-44 < y < 4.2000000000000002e-4

    1. Initial program 99.9%

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

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

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

Alternative 7: 76.9% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.69999999999999989e187

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

    if -4.69999999999999989e187 < x

    1. Initial program 86.8%

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

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

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

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

Alternative 8: 76.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{+187}:\\
\;\;\;\;\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 < -5.40000000000000016e187

    1. Initial program 79.5%

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{\frac{-1 \cdot z}{x}}} \]
      2. neg-mul-176.9%

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

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

    if -5.40000000000000016e187 < x

    1. Initial program 86.8%

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

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

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

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

Alternative 9: 57.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{z}\\

\mathbf{elif}\;x \leq 4.8 \cdot 10^{+83}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.6e19 or 4.79999999999999982e83 < x

    1. Initial program 91.2%

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

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

    if -3.6e19 < x < 4.79999999999999982e83

    1. Initial program 82.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{+83}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 10: 78.2% 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 86.3%

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

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

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

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

Alternative 11: 41.6% 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 86.3%

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

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

    \[\leadsto y \]

Developer target: 94.4% 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 2023187 
(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))