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

Percentage Accurate: 88.7% → 99.9%
Time: 7.4s
Alternatives: 11
Speedup: 0.7×

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.7% 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, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-60}:\\ \;\;\;\;\frac{x}{z} + y \cdot \left(1 - \frac{x}{z}\right)\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+15}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, z - x, x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y - \frac{y}{\frac{z}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -5e-60)
   (+ (/ x z) (* y (- 1.0 (/ x z))))
   (if (<= y 2.05e+15) (/ (fma y (- z x) x) z) (- y (/ y (/ z x))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -5e-60) {
		tmp = (x / z) + (y * (1.0 - (x / z)));
	} else if (y <= 2.05e+15) {
		tmp = fma(y, (z - x), x) / z;
	} else {
		tmp = y - (y / (z / x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (y <= -5e-60)
		tmp = Float64(Float64(x / z) + Float64(y * Float64(1.0 - Float64(x / z))));
	elseif (y <= 2.05e+15)
		tmp = Float64(fma(y, Float64(z - x), x) / z);
	else
		tmp = Float64(y - Float64(y / Float64(z / x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[y, -5e-60], N[(N[(x / z), $MachinePrecision] + N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e+15], N[(N[(y * N[(z - x), $MachinePrecision] + x), $MachinePrecision] / z), $MachinePrecision], N[(y - N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 2.05 \cdot 10^{+15}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, z - x, x\right)}{z}\\

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


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

    1. Initial program 79.0%

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

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

    if -5.0000000000000001e-60 < y < 2.05e15

    1. Initial program 100.0%

      \[\frac{x + y \cdot \left(z - x\right)}{z} \]
    2. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, z - x, x\right)}}{z} \]
    3. Simplified100.0%

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

    if 2.05e15 < y

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

        \[\leadsto y + \color{blue}{\frac{y}{z} \cdot \left(-x\right)} \]
      7. distribute-rgt-neg-out88.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-60}:\\ \;\;\;\;\frac{x}{z} + y \cdot \left(1 - \frac{x}{z}\right)\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+15}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, z - x, x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y - \frac{y}{\frac{z}{x}}\\ \end{array} \]

Alternative 2: 58.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \frac{y}{z}\\ t_1 := \frac{y}{\frac{-z}{x}}\\ \mathbf{if}\;y \leq -1.5 \cdot 10^{+269}:\\ \;\;\;\;\frac{z}{\frac{z}{y}}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+244}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{+177}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-108}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{-84}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+39}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (/ y z))) (t_1 (/ y (/ (- z) x))))
   (if (<= y -1.5e+269)
     (/ z (/ z y))
     (if (<= y -1.1e+244)
       t_1
       (if (<= y -7.8e+177)
         t_0
         (if (<= y -3.8e-108)
           y
           (if (<= y 5.3e-84) (/ x z) (if (<= y 4.9e+39) t_0 t_1))))))))
double code(double x, double y, double z) {
	double t_0 = z * (y / z);
	double t_1 = y / (-z / x);
	double tmp;
	if (y <= -1.5e+269) {
		tmp = z / (z / y);
	} else if (y <= -1.1e+244) {
		tmp = t_1;
	} else if (y <= -7.8e+177) {
		tmp = t_0;
	} else if (y <= -3.8e-108) {
		tmp = y;
	} else if (y <= 5.3e-84) {
		tmp = x / z;
	} else if (y <= 4.9e+39) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * (y / z)
    t_1 = y / (-z / x)
    if (y <= (-1.5d+269)) then
        tmp = z / (z / y)
    else if (y <= (-1.1d+244)) then
        tmp = t_1
    else if (y <= (-7.8d+177)) then
        tmp = t_0
    else if (y <= (-3.8d-108)) then
        tmp = y
    else if (y <= 5.3d-84) then
        tmp = x / z
    else if (y <= 4.9d+39) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (y / z);
	double t_1 = y / (-z / x);
	double tmp;
	if (y <= -1.5e+269) {
		tmp = z / (z / y);
	} else if (y <= -1.1e+244) {
		tmp = t_1;
	} else if (y <= -7.8e+177) {
		tmp = t_0;
	} else if (y <= -3.8e-108) {
		tmp = y;
	} else if (y <= 5.3e-84) {
		tmp = x / z;
	} else if (y <= 4.9e+39) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (y / z)
	t_1 = y / (-z / x)
	tmp = 0
	if y <= -1.5e+269:
		tmp = z / (z / y)
	elif y <= -1.1e+244:
		tmp = t_1
	elif y <= -7.8e+177:
		tmp = t_0
	elif y <= -3.8e-108:
		tmp = y
	elif y <= 5.3e-84:
		tmp = x / z
	elif y <= 4.9e+39:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(y / z))
	t_1 = Float64(y / Float64(Float64(-z) / x))
	tmp = 0.0
	if (y <= -1.5e+269)
		tmp = Float64(z / Float64(z / y));
	elseif (y <= -1.1e+244)
		tmp = t_1;
	elseif (y <= -7.8e+177)
		tmp = t_0;
	elseif (y <= -3.8e-108)
		tmp = y;
	elseif (y <= 5.3e-84)
		tmp = Float64(x / z);
	elseif (y <= 4.9e+39)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (y / z);
	t_1 = y / (-z / x);
	tmp = 0.0;
	if (y <= -1.5e+269)
		tmp = z / (z / y);
	elseif (y <= -1.1e+244)
		tmp = t_1;
	elseif (y <= -7.8e+177)
		tmp = t_0;
	elseif (y <= -3.8e-108)
		tmp = y;
	elseif (y <= 5.3e-84)
		tmp = x / z;
	elseif (y <= 4.9e+39)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y / N[((-z) / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.5e+269], N[(z / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.1e+244], t$95$1, If[LessEqual[y, -7.8e+177], t$95$0, If[LessEqual[y, -3.8e-108], y, If[LessEqual[y, 5.3e-84], N[(x / z), $MachinePrecision], If[LessEqual[y, 4.9e+39], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \frac{y}{z}\\
t_1 := \frac{y}{\frac{-z}{x}}\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+269}:\\
\;\;\;\;\frac{z}{\frac{z}{y}}\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{+244}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -7.8 \cdot 10^{+177}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-108}:\\
\;\;\;\;y\\

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

\mathbf{elif}\;y \leq 4.9 \cdot 10^{+39}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 42.9%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{z}} \]
      2. clear-num83.7%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      3. un-div-inv83.8%

        \[\leadsto \color{blue}{\frac{z}{\frac{z}{y}}} \]
    6. Applied egg-rr83.8%

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

    if -1.5000000000000001e269 < y < -1.10000000000000001e244 or 4.89999999999999987e39 < y

    1. Initial program 82.4%

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

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

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

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

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

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

    if -1.10000000000000001e244 < y < -7.7999999999999998e177 or 5.3000000000000004e-84 < y < 4.89999999999999987e39

    1. Initial program 79.3%

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

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

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

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

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

    if -7.7999999999999998e177 < y < -3.79999999999999973e-108

    1. Initial program 92.1%

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

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

    if -3.79999999999999973e-108 < y < 5.3000000000000004e-84

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{+269}:\\ \;\;\;\;\frac{z}{\frac{z}{y}}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+244}:\\ \;\;\;\;\frac{y}{\frac{-z}{x}}\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{+177}:\\ \;\;\;\;z \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-108}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{-84}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+39}:\\ \;\;\;\;z \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{-z}{x}}\\ \end{array} \]

Alternative 3: 99.8% accurate, 0.7× speedup?

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

\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 < -1e22 or 3.4e15 < y

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

        \[\leadsto y + \color{blue}{\frac{y}{z} \cdot \left(-x\right)} \]
      7. distribute-rgt-neg-out88.9%

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

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

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

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

    if -1e22 < y < 3.4e15

    1. Initial program 99.9%

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

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

Alternative 4: 99.9% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 79.0%

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

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

    if -1.9999999999999999e-60 < y < 2.05e15

    1. Initial program 100.0%

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

    if 2.05e15 < y

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

        \[\leadsto y + \color{blue}{\frac{y}{z} \cdot \left(-x\right)} \]
      7. distribute-rgt-neg-out88.8%

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

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

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

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

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

Alternative 5: 56.7% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 3 \cdot 10^{+165}:\\
\;\;\;\;y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.5e-108 or 5.2e-84 < y < 2.9999999999999999e165 or 2.4e193 < y

    1. Initial program 82.0%

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

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

    if -2.5e-108 < y < 5.2e-84

    1. Initial program 100.0%

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

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

    if 2.9999999999999999e165 < y < 2.4e193

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \frac{x + \color{blue}{\left(-y\right)} \cdot x}{z} \]
      4. cancel-sign-sub-inv100.0%

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

      \[\leadsto \frac{\color{blue}{x - y \cdot x}}{z} \]
    5. Step-by-step derivation
      1. frac-2neg100.0%

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

        \[\leadsto \color{blue}{\left(-\left(x - y \cdot x\right)\right) \cdot \frac{1}{-z}} \]
      3. add-sqr-sqrt56.7%

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

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

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

        \[\leadsto \left(-\left(x - y \cdot x\right)\right) \cdot \frac{1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      7. add-sqr-sqrt0.0%

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

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

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

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

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

        \[\leadsto \frac{0 - \color{blue}{\left(x + \left(-y \cdot x\right)\right)}}{z} \]
      5. distribute-rgt-neg-out0.0%

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

        \[\leadsto \frac{0 - \color{blue}{\left(y \cdot \left(-x\right) + x\right)}}{z} \]
      7. associate--r+0.0%

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

        \[\leadsto \frac{\color{blue}{\left(-y \cdot \left(-x\right)\right)} - x}{z} \]
      9. distribute-rgt-neg-out0.0%

        \[\leadsto \frac{\left(-\color{blue}{\left(-y \cdot x\right)}\right) - x}{z} \]
      10. remove-double-neg0.0%

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{z}} \]
      2. distribute-neg-frac59.0%

        \[\leadsto \color{blue}{\frac{-x}{z}} \]
    11. Simplified59.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{-108}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-84}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+165}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+193}:\\ \;\;\;\;\frac{-x}{z}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 6: 58.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -8 \cdot 10^{+177}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-108}:\\
\;\;\;\;y\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.0000000000000001e177 or 1.25e-84 < y

    1. Initial program 77.6%

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

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

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

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

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

    if -8.0000000000000001e177 < y < -1.4e-108

    1. Initial program 92.1%

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

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

    if -1.4e-108 < y < 1.25e-84

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+177}:\\ \;\;\;\;z \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-108}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-84}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{z}\\ \end{array} \]

Alternative 7: 74.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-94} \lor \neg \left(x \leq 1.6 \cdot 10^{-111}\right):\\
\;\;\;\;\frac{x}{z} \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.40000000000000002e-94 or 1.5999999999999999e-111 < x

    1. Initial program 90.7%

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

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

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

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

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

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

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

    if -4.40000000000000002e-94 < x < 1.5999999999999999e-111

    1. Initial program 84.3%

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

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

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

Alternative 8: 83.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-109} \lor \neg \left(y \leq 7.8 \cdot 10^{-85}\right):\\
\;\;\;\;y - \frac{y}{\frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.1000000000000002e-109 or 7.79999999999999977e-85 < y

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

        \[\leadsto y + \color{blue}{\frac{y}{z} \cdot \left(-x\right)} \]
      7. distribute-rgt-neg-out85.9%

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

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

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

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

    if -4.1000000000000002e-109 < y < 7.79999999999999977e-85

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

Alternative 9: 83.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-109} \lor \neg \left(y \leq 3.2 \cdot 10^{-84}\right):\\
\;\;\;\;y - \frac{y}{\frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.49999999999999933e-109 or 3.1999999999999999e-84 < y

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

        \[\leadsto y + \color{blue}{\frac{y}{z} \cdot \left(-x\right)} \]
      7. distribute-rgt-neg-out85.9%

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

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

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

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

    if -9.49999999999999933e-109 < y < 3.1999999999999999e-84

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \frac{x + \color{blue}{\left(-y\right)} \cdot x}{z} \]
      4. cancel-sign-sub-inv81.9%

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

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

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

Alternative 10: 57.4% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.79999999999999977e-109 or 7.79999999999999977e-85 < y

    1. Initial program 82.8%

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

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

    if -4.79999999999999977e-109 < y < 7.79999999999999977e-85

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-109}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-85}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 11: 40.5% 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.4%

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

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

    \[\leadsto y \]

Developer target: 93.9% 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 2023290 
(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))