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

Percentage Accurate: 88.4% → 99.8%
Time: 8.3s
Alternatives: 10
Speedup: 0.5×

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: 88.4% 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.8% accurate, 0.5× speedup?

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

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


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

    1. Initial program 74.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{z}} \]
      2. div-sub99.9%

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

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

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

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

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

    if -6.2e15 < y < 5.8e15

    1. Initial program 99.9%

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

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

Alternative 2: 98.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+15} \lor \neg \left(y \leq 7.5 \cdot 10^{-25}\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 -5.5e+15) (not (<= y 7.5e-25)))
   (* y (- 1.0 (/ x z)))
   (+ y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -5.5e+15) || !(y <= 7.5e-25)) {
		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 <= (-5.5d+15)) .or. (.not. (y <= 7.5d-25))) 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 <= -5.5e+15) || !(y <= 7.5e-25)) {
		tmp = y * (1.0 - (x / z));
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -5.5e+15) or not (y <= 7.5e-25):
		tmp = y * (1.0 - (x / z))
	else:
		tmp = y + (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -5.5e+15) || !(y <= 7.5e-25))
		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 <= -5.5e+15) || ~((y <= 7.5e-25)))
		tmp = y * (1.0 - (x / z));
	else
		tmp = y + (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.5e+15], N[Not[LessEqual[y, 7.5e-25]], $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 -5.5 \cdot 10^{+15} \lor \neg \left(y \leq 7.5 \cdot 10^{-25}\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 < -5.5e15 or 7.49999999999999989e-25 < y

    1. Initial program 75.6%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{z}} \]
      2. div-sub99.5%

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

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

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

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

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

    if -5.5e15 < y < 7.49999999999999989e-25

    1. Initial program 99.9%

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

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

      \[\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 -5.5 \cdot 10^{+15} \lor \neg \left(y \leq 7.5 \cdot 10^{-25}\right):\\ \;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.00156 \lor \neg \left(x \leq 7.2 \cdot 10^{+57}\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.00156) (not (<= x 7.2e+57)))
   (* x (/ (- 1.0 y) z))
   (+ y (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -0.00156) || !(x <= 7.2e+57)) {
		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.00156d0)) .or. (.not. (x <= 7.2d+57))) 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.00156) || !(x <= 7.2e+57)) {
		tmp = x * ((1.0 - y) / z);
	} else {
		tmp = y + (x / z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -0.00156) or not (x <= 7.2e+57):
		tmp = x * ((1.0 - y) / z)
	else:
		tmp = y + (x / z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -0.00156) || !(x <= 7.2e+57))
		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.00156) || ~((x <= 7.2e+57)))
		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.00156], N[Not[LessEqual[x, 7.2e+57]], $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.00156 \lor \neg \left(x \leq 7.2 \cdot 10^{+57}\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.00155999999999999997 or 7.2000000000000005e57 < x

    1. Initial program 90.2%

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

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

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

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

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

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

    if -0.00155999999999999997 < x < 7.2000000000000005e57

    1. Initial program 84.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.00156 \lor \neg \left(x \leq 7.2 \cdot 10^{+57}\right):\\ \;\;\;\;x \cdot \frac{1 - y}{z}\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.1% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 77.4%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{z}} \]
      2. div-sub99.9%

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

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

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

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

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

    if -5.5e15 < y < 7.49999999999999989e-25

    1. Initial program 99.9%

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

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

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

    if 7.49999999999999989e-25 < y

    1. Initial program 73.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y - y \cdot \frac{x}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 77.3% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 76.9%

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{1 - y}}{z} \]
    5. Simplified69.2%

      \[\leadsto \color{blue}{x \cdot \frac{1 - y}{z}} \]
    6. Taylor expanded in y around inf 69.2%

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

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

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

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

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

    if -5.50000000000000019e233 < y < 7.49999999999999989e-25

    1. Initial program 93.3%

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

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

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

    if 7.49999999999999989e-25 < y

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{x}} \]
    8. Applied egg-rr64.9%

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

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

Alternative 6: 59.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+76}:\\
\;\;\;\;z \cdot \frac{y}{z}\\

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

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


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

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{y}{x}} \]
    7. Step-by-step derivation
      1. *-commutative28.5%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot x} \]
      2. frac-2neg28.5%

        \[\leadsto \color{blue}{\frac{-y}{-x}} \cdot x \]
      3. associate-*l/53.1%

        \[\leadsto \color{blue}{\frac{\left(-y\right) \cdot x}{-x}} \]
      4. add-sqr-sqrt23.3%

        \[\leadsto \frac{\left(-y\right) \cdot x}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}} \]
      5. sqrt-unprod14.3%

        \[\leadsto \frac{\left(-y\right) \cdot x}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}} \]
      6. sqr-neg14.3%

        \[\leadsto \frac{\left(-y\right) \cdot x}{\sqrt{\color{blue}{x \cdot x}}} \]
      7. sqrt-unprod6.3%

        \[\leadsto \frac{\left(-y\right) \cdot x}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} \]
      8. add-sqr-sqrt14.0%

        \[\leadsto \frac{\left(-y\right) \cdot x}{\color{blue}{x}} \]
    8. Applied egg-rr14.0%

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

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{x}{x}} \]
      2. *-inverses2.6%

        \[\leadsto \left(-y\right) \cdot \color{blue}{1} \]
      3. *-rgt-identity2.6%

        \[\leadsto \color{blue}{-y} \]
    10. Simplified2.6%

      \[\leadsto \color{blue}{-y} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt2.6%

        \[\leadsto \color{blue}{\sqrt{-y} \cdot \sqrt{-y}} \]
      2. sqrt-unprod15.5%

        \[\leadsto \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \]
      3. sqr-neg15.5%

        \[\leadsto \sqrt{\color{blue}{y \cdot y}} \]
      4. sqrt-unprod0.0%

        \[\leadsto \color{blue}{\sqrt{y} \cdot \sqrt{y}} \]
      5. add-sqr-sqrt50.0%

        \[\leadsto \color{blue}{y} \]
      6. *-un-lft-identity50.0%

        \[\leadsto \color{blue}{1 \cdot y} \]
      7. *-commutative50.0%

        \[\leadsto \color{blue}{y \cdot 1} \]
      8. *-inverses50.0%

        \[\leadsto y \cdot \color{blue}{\frac{z}{z}} \]
      9. associate-/l*31.9%

        \[\leadsto \color{blue}{\frac{y \cdot z}{z}} \]
      10. *-commutative31.9%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{z} \]
      11. associate-/l*50.0%

        \[\leadsto \color{blue}{z \cdot \frac{y}{z}} \]
    12. Applied egg-rr50.0%

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

    if -6.5000000000000005e76 < y < 1.9499999999999999e-29

    1. Initial program 99.9%

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

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

    if 1.9499999999999999e-29 < y

    1. Initial program 73.8%

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

      \[\leadsto \color{blue}{y} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 59.0% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.5000000000000005e76 or 3.40000000000000013e-26 < y

    1. Initial program 73.7%

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

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

    if -6.5000000000000005e76 < y < 3.40000000000000013e-26

    1. Initial program 99.9%

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

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

Alternative 8: 78.3% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 91.9%

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

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

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

    if 7.49999999999999989e-25 < y

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{x}} \]
    8. Applied egg-rr64.9%

      \[\leadsto \color{blue}{\frac{y \cdot x}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 78.0% accurate, 1.8× speedup?

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

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

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

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

    \[\leadsto \color{blue}{y + \frac{x}{z}} \]
  5. Add Preprocessing

Alternative 10: 40.8% 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. Add Preprocessing
  3. Taylor expanded in x around 0 39.9%

    \[\leadsto \color{blue}{y} \]
  4. Add Preprocessing

Developer Target 1: 94.3% 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 2024130 
(FPCore (x y z)
  :name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
  :precision binary64

  :alt
  (! :herbie-platform default (- (+ y (/ x z)) (/ y (/ z x))))

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