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

Percentage Accurate: 88.0% → 99.9%
Time: 8.3s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 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.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -155000000000 \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 -155000000000.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 <= -155000000000.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 <= (-155000000000.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 <= -155000000000.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 <= -155000000000.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 <= -155000000000.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 <= -155000000000.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, -155000000000.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 -155000000000 \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.55e11 or 1 < y

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

    if -1.55e11 < y < 1

    1. Initial program 99.9%

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

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

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

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

Alternative 3: 83.5% accurate, 0.5× speedup?

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

    1. Initial program 90.9%

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

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

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

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

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

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

    if -2.54999999999999992e-64 < x < 53000

    1. Initial program 85.5%

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

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

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

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

Alternative 4: 75.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+107} \lor \neg \left(y \leq 1.16 \cdot 10^{+172}\right):\\
\;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1e107 or 1.15999999999999994e172 < y

    1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{z} \cdot x} \]
      3. add-sqr-sqrt33.5%

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{y \cdot y}}}{z} \cdot x \]
      6. sqrt-unprod0.3%

        \[\leadsto \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z} \cdot x \]
      7. add-sqr-sqrt0.9%

        \[\leadsto \frac{\color{blue}{y}}{z} \cdot x \]
      8. associate-/r/0.9%

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

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

        \[\leadsto \color{blue}{\frac{y}{-z} \cdot \left(-x\right)} \]
    10. Applied egg-rr60.3%

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

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

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

        \[\leadsto -\frac{\color{blue}{y \cdot x}}{z} \]
      3. distribute-frac-neg263.0%

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

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

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

    if -2.1e107 < y < 1.15999999999999994e172

    1. Initial program 93.8%

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

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

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

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

Alternative 5: 75.2% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 69.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{z}{x}}{1 - y}}} \]
    7. Applied egg-rr62.8%

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

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

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

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

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

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

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

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

    if -2.1e107 < y < 1.64999999999999991e172

    1. Initial program 93.8%

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

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

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

    if 1.64999999999999991e172 < y

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{z} \cdot x} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z} \cdot x \]
      4. sqrt-unprod1.3%

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

        \[\leadsto \frac{\sqrt{\color{blue}{y \cdot y}}}{z} \cdot x \]
      6. sqrt-unprod0.8%

        \[\leadsto \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z} \cdot x \]
      7. add-sqr-sqrt0.8%

        \[\leadsto \frac{\color{blue}{y}}{z} \cdot x \]
      8. associate-/r/0.7%

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

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

        \[\leadsto \color{blue}{\frac{y}{-z} \cdot \left(-x\right)} \]
    10. Applied egg-rr70.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+107}:\\ \;\;\;\;\frac{-y}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+172}:\\ \;\;\;\;y + \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 56.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-65} \lor \neg \left(x \leq 1.5 \cdot 10^{-27}\right):\\
\;\;\;\;\frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.30000000000000005e-65 or 1.5000000000000001e-27 < x

    1. Initial program 91.3%

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

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

    if -1.30000000000000005e-65 < x < 1.5000000000000001e-27

    1. Initial program 84.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{-65} \lor \neg \left(x \leq 1.5 \cdot 10^{-27}\right):\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.0% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 89.3%

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

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

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

    if 4.3000000000000003e172 < y

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.3% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 90.9%

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

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

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

    if 1 < y

    1. Initial program 81.0%

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

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

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

        \[\leadsto y + \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z} \]
      2. sqrt-unprod56.7%

        \[\leadsto y + \frac{\color{blue}{\sqrt{x \cdot x}}}{z} \]
      3. sqr-neg56.7%

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

        \[\leadsto y + \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{z} \]
      5. add-sqr-sqrt61.9%

        \[\leadsto y + \frac{\color{blue}{-x}}{z} \]
      6. distribute-neg-frac61.9%

        \[\leadsto y + \color{blue}{\left(-\frac{x}{z}\right)} \]
    6. Applied egg-rr61.9%

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

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

Alternative 9: 77.9% 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 88.6%

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

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

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

Alternative 10: 41.0% 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 88.6%

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

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

Developer Target 1: 94.1% 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 2024176 
(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))