Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J

Percentage Accurate: 95.9% → 97.7%
Time: 9.1s
Alternatives: 11
Speedup: 1.0×

Specification

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

\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\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: 95.9% accurate, 1.0× speedup?

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

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

Alternative 1: 97.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \left(y + -1\right)\\
\mathbf{if}\;1 + t\_0 \leq -5 \cdot 10^{+277}:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x + x \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 #s(literal 1 binary64) (*.f64 (-.f64 #s(literal 1 binary64) y) z)) < -4.99999999999999982e277

    1. Initial program 74.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right)}\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto 1 \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x} \]
      3. fma-defineN/A

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{x}, \left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x\right) \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(1, x, \mathsf{neg}\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)\right) \]
      5. fmm-undefN/A

        \[\leadsto 1 \cdot x - \color{blue}{\left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      6. *-lft-identityN/A

        \[\leadsto x - \color{blue}{\left(\left(1 - y\right) \cdot z\right)} \cdot x \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(\left(1 - y\right) \cdot z\right), \color{blue}{x}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 - y\right), z\right), x\right)\right) \]
      10. --lowering--.f6474.0%

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), z\right), x\right)\right) \]
    4. Applied egg-rr74.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(z \cdot \left(1 - y\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto -1 \cdot \left(x \cdot \left(\left(1 - y\right) \cdot \color{blue}{z}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right) \cdot \color{blue}{z} \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right)}\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(x \cdot \left(1 - y\right)\right)\right)\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)}\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x \cdot \left(-1 \cdot \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \color{blue}{\left(-1 \cdot \left(1 - y\right)\right)}\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(0 - \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      12. associate--r-N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(\left(0 - 1\right) + \color{blue}{y}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(-1 + y\right)\right)\right) \]
      14. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(y + \color{blue}{-1}\right)\right)\right) \]
      15. +-lowering-+.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(y, \color{blue}{-1}\right)\right)\right) \]
    7. Simplified100.0%

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

    if -4.99999999999999982e277 < (-.f64 #s(literal 1 binary64) (*.f64 (-.f64 #s(literal 1 binary64) y) z))

    1. Initial program 98.7%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right)}\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto 1 \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x} \]
      3. fma-defineN/A

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{x}, \left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x\right) \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(1, x, \mathsf{neg}\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)\right) \]
      5. fmm-undefN/A

        \[\leadsto 1 \cdot x - \color{blue}{\left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      6. *-lft-identityN/A

        \[\leadsto x - \color{blue}{\left(\left(1 - y\right) \cdot z\right)} \cdot x \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(\left(1 - y\right) \cdot z\right), \color{blue}{x}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 - y\right), z\right), x\right)\right) \]
      10. --lowering--.f6498.7%

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), z\right), x\right)\right) \]
    4. Applied egg-rr98.7%

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

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

Alternative 2: 97.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := 1 + z \cdot \left(y + -1\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+277}:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 #s(literal 1 binary64) (*.f64 (-.f64 #s(literal 1 binary64) y) z)) < -4.99999999999999982e277

    1. Initial program 74.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right)}\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto 1 \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x} \]
      3. fma-defineN/A

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{x}, \left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x\right) \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(1, x, \mathsf{neg}\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)\right) \]
      5. fmm-undefN/A

        \[\leadsto 1 \cdot x - \color{blue}{\left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      6. *-lft-identityN/A

        \[\leadsto x - \color{blue}{\left(\left(1 - y\right) \cdot z\right)} \cdot x \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(\left(1 - y\right) \cdot z\right), \color{blue}{x}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 - y\right), z\right), x\right)\right) \]
      10. --lowering--.f6474.0%

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), z\right), x\right)\right) \]
    4. Applied egg-rr74.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(z \cdot \left(1 - y\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto -1 \cdot \left(x \cdot \left(\left(1 - y\right) \cdot \color{blue}{z}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right) \cdot \color{blue}{z} \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right)}\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(x \cdot \left(1 - y\right)\right)\right)\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)}\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x \cdot \left(-1 \cdot \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \color{blue}{\left(-1 \cdot \left(1 - y\right)\right)}\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(0 - \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      12. associate--r-N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(\left(0 - 1\right) + \color{blue}{y}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(-1 + y\right)\right)\right) \]
      14. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(y + \color{blue}{-1}\right)\right)\right) \]
      15. +-lowering-+.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(y, \color{blue}{-1}\right)\right)\right) \]
    7. Simplified100.0%

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

    if -4.99999999999999982e277 < (-.f64 #s(literal 1 binary64) (*.f64 (-.f64 #s(literal 1 binary64) y) z))

    1. Initial program 98.7%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

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

Alternative 3: 98.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\mathbf{if}\;z \leq -0.96:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 + y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.95999999999999996 or 6.80000000000000012e-6 < z

    1. Initial program 92.2%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right)}\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto 1 \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x} \]
      3. fma-defineN/A

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{x}, \left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x\right) \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(1, x, \mathsf{neg}\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)\right) \]
      5. fmm-undefN/A

        \[\leadsto 1 \cdot x - \color{blue}{\left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      6. *-lft-identityN/A

        \[\leadsto x - \color{blue}{\left(\left(1 - y\right) \cdot z\right)} \cdot x \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(\left(1 - y\right) \cdot z\right), \color{blue}{x}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 - y\right), z\right), x\right)\right) \]
      10. --lowering--.f6492.1%

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), z\right), x\right)\right) \]
    4. Applied egg-rr92.1%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(z \cdot \left(1 - y\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto -1 \cdot \left(x \cdot \left(\left(1 - y\right) \cdot \color{blue}{z}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right) \cdot \color{blue}{z} \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right)}\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(x \cdot \left(1 - y\right)\right)\right)\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)}\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x \cdot \left(-1 \cdot \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \color{blue}{\left(-1 \cdot \left(1 - y\right)\right)}\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(0 - \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      12. associate--r-N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(\left(0 - 1\right) + \color{blue}{y}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(-1 + y\right)\right)\right) \]
      14. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(y + \color{blue}{-1}\right)\right)\right) \]
      15. +-lowering-+.f6498.0%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(y, \color{blue}{-1}\right)\right)\right) \]
    7. Simplified98.0%

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

    if -0.95999999999999996 < z < 6.80000000000000012e-6

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \left(z \cdot \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      2. flip3--N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \left(z \cdot \frac{{1}^{3} - {y}^{3}}{\color{blue}{1 \cdot 1 + \left(y \cdot y + 1 \cdot y\right)}}\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \left(z \cdot \frac{1}{\color{blue}{\frac{1 \cdot 1 + \left(y \cdot y + 1 \cdot y\right)}{{1}^{3} - {y}^{3}}}}\right)\right)\right) \]
      4. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \left(\frac{z}{\color{blue}{\frac{1 \cdot 1 + \left(y \cdot y + 1 \cdot y\right)}{{1}^{3} - {y}^{3}}}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \color{blue}{\left(\frac{1 \cdot 1 + \left(y \cdot y + 1 \cdot y\right)}{{1}^{3} - {y}^{3}}\right)}\right)\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \left(\frac{1}{\color{blue}{\frac{{1}^{3} - {y}^{3}}{1 \cdot 1 + \left(y \cdot y + 1 \cdot y\right)}}}\right)\right)\right)\right) \]
      7. flip3--N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \left(\frac{1}{1 - \color{blue}{y}}\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \mathsf{/.f64}\left(1, \color{blue}{\left(1 - y\right)}\right)\right)\right)\right) \]
      9. --lowering--.f6499.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \color{blue}{y}\right)\right)\right)\right)\right) \]
    4. Applied egg-rr99.8%

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

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \color{blue}{\left(\frac{-1}{y}\right)}\right)\right)\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6498.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(z, \mathsf{/.f64}\left(-1, \color{blue}{y}\right)\right)\right)\right) \]
    7. Simplified98.8%

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

        \[\leadsto \left(1 - \frac{z}{\frac{-1}{y}}\right) \cdot \color{blue}{x} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 - \frac{z}{\frac{-1}{y}}\right), \color{blue}{x}\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 - \frac{z}{-1} \cdot y\right), x\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 - \left(z \cdot \frac{1}{-1}\right) \cdot y\right), x\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 - \left(z \cdot -1\right) \cdot y\right), x\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 - \left(-1 \cdot z\right) \cdot y\right), x\right) \]
      7. neg-mul-1N/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 - \left(\mathsf{neg}\left(z\right)\right) \cdot y\right), x\right) \]
      8. cancel-sign-subN/A

        \[\leadsto \mathsf{*.f64}\left(\left(1 + z \cdot y\right), x\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(z \cdot y\right)\right), x\right) \]
      10. *-lowering-*.f6498.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(z, y\right)\right), x\right) \]
    9. Applied egg-rr98.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.96:\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \left(1 + y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 87.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\mathbf{if}\;z \leq -135000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 1.18 \cdot 10^{-9}:\\
\;\;\;\;x - x \cdot z\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -135000 or 1.1800000000000001e-9 < z

    1. Initial program 92.1%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right)}\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto 1 \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x} \]
      3. fma-defineN/A

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{x}, \left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x\right) \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(1, x, \mathsf{neg}\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)\right) \]
      5. fmm-undefN/A

        \[\leadsto 1 \cdot x - \color{blue}{\left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      6. *-lft-identityN/A

        \[\leadsto x - \color{blue}{\left(\left(1 - y\right) \cdot z\right)} \cdot x \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(\left(1 - y\right) \cdot z\right), \color{blue}{x}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 - y\right), z\right), x\right)\right) \]
      10. --lowering--.f6492.0%

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), z\right), x\right)\right) \]
    4. Applied egg-rr92.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(z \cdot \left(1 - y\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto -1 \cdot \left(x \cdot \left(\left(1 - y\right) \cdot \color{blue}{z}\right)\right) \]
      2. associate-*r*N/A

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

        \[\leadsto \left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right) \cdot \color{blue}{z} \]
      4. *-commutativeN/A

        \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(x \cdot \left(1 - y\right)\right)\right)}\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(x \cdot \left(1 - y\right)\right)\right)\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)}\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x \cdot \left(-1 \cdot \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \color{blue}{\left(-1 \cdot \left(1 - y\right)\right)}\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(0 - \color{blue}{\left(1 - y\right)}\right)\right)\right) \]
      12. associate--r-N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(\left(0 - 1\right) + \color{blue}{y}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(-1 + y\right)\right)\right) \]
      14. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \left(y + \color{blue}{-1}\right)\right)\right) \]
      15. +-lowering-+.f6498.8%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(y, \color{blue}{-1}\right)\right)\right) \]
    7. Simplified98.8%

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

    if -135000 < z < 1.1800000000000001e-9

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right)}\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto 1 \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x} \]
      3. fma-defineN/A

        \[\leadsto \mathsf{fma}\left(1, \color{blue}{x}, \left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x\right) \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{fma}\left(1, x, \mathsf{neg}\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)\right) \]
      5. fmm-undefN/A

        \[\leadsto 1 \cdot x - \color{blue}{\left(\left(1 - y\right) \cdot z\right) \cdot x} \]
      6. *-lft-identityN/A

        \[\leadsto x - \color{blue}{\left(\left(1 - y\right) \cdot z\right)} \cdot x \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(\left(1 - y\right) \cdot z\right), \color{blue}{x}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 - y\right), z\right), x\right)\right) \]
      10. --lowering--.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), z\right), x\right)\right) \]
    4. Applied egg-rr99.9%

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

      \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\color{blue}{z}, x\right)\right) \]
    6. Step-by-step derivation
      1. Simplified77.7%

        \[\leadsto x - \color{blue}{z} \cdot x \]
    7. Recombined 2 regimes into one program.
    8. Final simplification88.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -135000:\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{-9}:\\ \;\;\;\;x - x \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 5: 85.4% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.8 \cdot 10^{+78}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+28}:\\ \;\;\;\;x - x \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y -9.8e+78)
       (* z (* x y))
       (if (<= y 1.75e+28) (- x (* x z)) (* y (* x z)))))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= -9.8e+78) {
    		tmp = z * (x * y);
    	} else if (y <= 1.75e+28) {
    		tmp = x - (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 <= (-9.8d+78)) then
            tmp = z * (x * y)
        else if (y <= 1.75d+28) then
            tmp = x - (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 <= -9.8e+78) {
    		tmp = z * (x * y);
    	} else if (y <= 1.75e+28) {
    		tmp = x - (x * z);
    	} else {
    		tmp = y * (x * z);
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= -9.8e+78:
    		tmp = z * (x * y)
    	elif y <= 1.75e+28:
    		tmp = x - (x * z)
    	else:
    		tmp = y * (x * z)
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= -9.8e+78)
    		tmp = Float64(z * Float64(x * y));
    	elseif (y <= 1.75e+28)
    		tmp = Float64(x - 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 <= -9.8e+78)
    		tmp = z * (x * y);
    	elseif (y <= 1.75e+28)
    		tmp = x - (x * z);
    	else
    		tmp = y * (x * z);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, -9.8e+78], N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+28], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -9.8 \cdot 10^{+78}:\\
    \;\;\;\;z \cdot \left(x \cdot y\right)\\
    
    \mathbf{elif}\;y \leq 1.75 \cdot 10^{+28}:\\
    \;\;\;\;x - x \cdot z\\
    
    \mathbf{else}:\\
    \;\;\;\;y \cdot \left(x \cdot z\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -9.8000000000000004e78

      1. Initial program 88.7%

        \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

        \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(y \cdot z\right)}\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{y}\right)\right) \]
        3. *-lowering-*.f6472.8%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{y}\right)\right) \]
      5. Simplified72.8%

        \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
        2. associate-*r*N/A

          \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{z} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(x \cdot y\right), \color{blue}{z}\right) \]
        4. *-lowering-*.f6479.7%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, y\right), z\right) \]
      7. Applied egg-rr79.7%

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

      if -9.8000000000000004e78 < y < 1.75e28

      1. Initial program 99.9%

        \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto x \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right)}\right) \]
        2. distribute-rgt-inN/A

          \[\leadsto 1 \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x} \]
        3. fma-defineN/A

          \[\leadsto \mathsf{fma}\left(1, \color{blue}{x}, \left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x\right) \]
        4. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{fma}\left(1, x, \mathsf{neg}\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)\right) \]
        5. fmm-undefN/A

          \[\leadsto 1 \cdot x - \color{blue}{\left(\left(1 - y\right) \cdot z\right) \cdot x} \]
        6. *-lft-identityN/A

          \[\leadsto x - \color{blue}{\left(\left(1 - y\right) \cdot z\right)} \cdot x \]
        7. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(\left(1 - y\right) \cdot z\right), \color{blue}{x}\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 - y\right), z\right), x\right)\right) \]
        10. --lowering--.f64100.0%

          \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), z\right), x\right)\right) \]
      4. Applied egg-rr100.0%

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

        \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\color{blue}{z}, x\right)\right) \]
      6. Step-by-step derivation
        1. Simplified96.0%

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

        if 1.75e28 < y

        1. Initial program 91.7%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(y \cdot z\right)}\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{y}\right)\right) \]
          3. *-lowering-*.f6461.7%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{y}\right)\right) \]
        5. Simplified61.7%

          \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]
        6. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left(x \cdot z\right) \cdot \color{blue}{y} \]
          2. *-commutativeN/A

            \[\leadsto \left(z \cdot x\right) \cdot y \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(z \cdot x\right), \color{blue}{y}\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\left(x \cdot z\right), y\right) \]
          5. *-lowering-*.f6467.0%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, z\right), y\right) \]
        7. Applied egg-rr67.0%

          \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot y} \]
      7. Recombined 3 regimes into one program.
      8. Final simplification85.5%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.8 \cdot 10^{+78}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+28}:\\ \;\;\;\;x - x \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \end{array} \]
      9. Add Preprocessing

      Alternative 6: 85.3% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{+82}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{+29}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -2.15e+82)
         (* z (* x y))
         (if (<= y 1.26e+29) (* x (- 1.0 z)) (* y (* x z)))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -2.15e+82) {
      		tmp = z * (x * y);
      	} else if (y <= 1.26e+29) {
      		tmp = x * (1.0 - z);
      	} else {
      		tmp = y * (x * z);
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: tmp
          if (y <= (-2.15d+82)) then
              tmp = z * (x * y)
          else if (y <= 1.26d+29) then
              tmp = x * (1.0d0 - z)
          else
              tmp = y * (x * z)
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -2.15e+82) {
      		tmp = z * (x * y);
      	} else if (y <= 1.26e+29) {
      		tmp = x * (1.0 - z);
      	} else {
      		tmp = y * (x * z);
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if y <= -2.15e+82:
      		tmp = z * (x * y)
      	elif y <= 1.26e+29:
      		tmp = x * (1.0 - z)
      	else:
      		tmp = y * (x * z)
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -2.15e+82)
      		tmp = Float64(z * Float64(x * y));
      	elseif (y <= 1.26e+29)
      		tmp = Float64(x * Float64(1.0 - z));
      	else
      		tmp = Float64(y * Float64(x * z));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (y <= -2.15e+82)
      		tmp = z * (x * y);
      	elseif (y <= 1.26e+29)
      		tmp = x * (1.0 - z);
      	else
      		tmp = y * (x * z);
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -2.15e+82], N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.26e+29], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -2.15 \cdot 10^{+82}:\\
      \;\;\;\;z \cdot \left(x \cdot y\right)\\
      
      \mathbf{elif}\;y \leq 1.26 \cdot 10^{+29}:\\
      \;\;\;\;x \cdot \left(1 - z\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;y \cdot \left(x \cdot z\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -2.15000000000000007e82

        1. Initial program 88.7%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(y \cdot z\right)}\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{y}\right)\right) \]
          3. *-lowering-*.f6472.8%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{y}\right)\right) \]
        5. Simplified72.8%

          \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
          2. associate-*r*N/A

            \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{z} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(x \cdot y\right), \color{blue}{z}\right) \]
          4. *-lowering-*.f6479.7%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, y\right), z\right) \]
        7. Applied egg-rr79.7%

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

        if -2.15000000000000007e82 < y < 1.26e29

        1. Initial program 99.9%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 - z\right)}\right) \]
          2. --lowering--.f6495.9%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{z}\right)\right) \]
        5. Simplified95.9%

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

        if 1.26e29 < y

        1. Initial program 91.7%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(y \cdot z\right)}\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{y}\right)\right) \]
          3. *-lowering-*.f6461.7%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{y}\right)\right) \]
        5. Simplified61.7%

          \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]
        6. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left(x \cdot z\right) \cdot \color{blue}{y} \]
          2. *-commutativeN/A

            \[\leadsto \left(z \cdot x\right) \cdot y \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(z \cdot x\right), \color{blue}{y}\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\left(x \cdot z\right), y\right) \]
          5. *-lowering-*.f6467.0%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, z\right), y\right) \]
        7. Applied egg-rr67.0%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{+82}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{+29}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot z\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 85.1% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(x \cdot y\right)\\ \mathbf{if}\;y \leq -6 \cdot 10^{+82}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* z (* x y))))
         (if (<= y -6e+82) t_0 (if (<= y 1.85e+28) (* x (- 1.0 z)) t_0))))
      double code(double x, double y, double z) {
      	double t_0 = z * (x * y);
      	double tmp;
      	if (y <= -6e+82) {
      		tmp = t_0;
      	} else if (y <= 1.85e+28) {
      		tmp = x * (1.0 - 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 * (x * y)
          if (y <= (-6d+82)) then
              tmp = t_0
          else if (y <= 1.85d+28) then
              tmp = x * (1.0d0 - 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 * (x * y);
      	double tmp;
      	if (y <= -6e+82) {
      		tmp = t_0;
      	} else if (y <= 1.85e+28) {
      		tmp = x * (1.0 - z);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = z * (x * y)
      	tmp = 0
      	if y <= -6e+82:
      		tmp = t_0
      	elif y <= 1.85e+28:
      		tmp = x * (1.0 - z)
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(z * Float64(x * y))
      	tmp = 0.0
      	if (y <= -6e+82)
      		tmp = t_0;
      	elseif (y <= 1.85e+28)
      		tmp = Float64(x * Float64(1.0 - z));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = z * (x * y);
      	tmp = 0.0;
      	if (y <= -6e+82)
      		tmp = t_0;
      	elseif (y <= 1.85e+28)
      		tmp = x * (1.0 - z);
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+82], t$95$0, If[LessEqual[y, 1.85e+28], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := z \cdot \left(x \cdot y\right)\\
      \mathbf{if}\;y \leq -6 \cdot 10^{+82}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;y \leq 1.85 \cdot 10^{+28}:\\
      \;\;\;\;x \cdot \left(1 - z\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -5.99999999999999978e82 or 1.85e28 < y

        1. Initial program 90.6%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(y \cdot z\right)}\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{y}\right)\right) \]
          3. *-lowering-*.f6465.9%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{y}\right)\right) \]
        5. Simplified65.9%

          \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x \cdot \left(y \cdot \color{blue}{z}\right) \]
          2. associate-*r*N/A

            \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{z} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\left(x \cdot y\right), \color{blue}{z}\right) \]
          4. *-lowering-*.f6471.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, y\right), z\right) \]
        7. Applied egg-rr71.1%

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

        if -5.99999999999999978e82 < y < 1.85e28

        1. Initial program 99.9%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 - z\right)}\right) \]
          2. --lowering--.f6495.9%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{z}\right)\right) \]
        5. Simplified95.9%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+82}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 82.7% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(y \cdot z\right)\\ \mathbf{if}\;y \leq -2.45 \cdot 10^{+115}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* x (* y z))))
         (if (<= y -2.45e+115) t_0 (if (<= y 1.25e+28) (* x (- 1.0 z)) t_0))))
      double code(double x, double y, double z) {
      	double t_0 = x * (y * z);
      	double tmp;
      	if (y <= -2.45e+115) {
      		tmp = t_0;
      	} else if (y <= 1.25e+28) {
      		tmp = x * (1.0 - 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 = x * (y * z)
          if (y <= (-2.45d+115)) then
              tmp = t_0
          else if (y <= 1.25d+28) then
              tmp = x * (1.0d0 - z)
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = x * (y * z);
      	double tmp;
      	if (y <= -2.45e+115) {
      		tmp = t_0;
      	} else if (y <= 1.25e+28) {
      		tmp = x * (1.0 - z);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = x * (y * z)
      	tmp = 0
      	if y <= -2.45e+115:
      		tmp = t_0
      	elif y <= 1.25e+28:
      		tmp = x * (1.0 - z)
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(x * Float64(y * z))
      	tmp = 0.0
      	if (y <= -2.45e+115)
      		tmp = t_0;
      	elseif (y <= 1.25e+28)
      		tmp = Float64(x * Float64(1.0 - z));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = x * (y * z);
      	tmp = 0.0;
      	if (y <= -2.45e+115)
      		tmp = t_0;
      	elseif (y <= 1.25e+28)
      		tmp = x * (1.0 - z);
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.45e+115], t$95$0, If[LessEqual[y, 1.25e+28], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x \cdot \left(y \cdot z\right)\\
      \mathbf{if}\;y \leq -2.45 \cdot 10^{+115}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;y \leq 1.25 \cdot 10^{+28}:\\
      \;\;\;\;x \cdot \left(1 - z\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -2.44999999999999982e115 or 1.24999999999999989e28 < y

        1. Initial program 92.4%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(y \cdot z\right)}\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{y}\right)\right) \]
          3. *-lowering-*.f6468.5%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{y}\right)\right) \]
        5. Simplified68.5%

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

        if -2.44999999999999982e115 < y < 1.24999999999999989e28

        1. Initial program 98.1%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(1 - z\right)}\right) \]
          2. --lowering--.f6493.2%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{z}\right)\right) \]
        5. Simplified93.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.45 \cdot 10^{+115}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 9: 60.2% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(y \cdot z\right)\\ \mathbf{if}\;z \leq -102000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-10}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* x (* y z))))
         (if (<= z -102000.0) t_0 (if (<= z 3.2e-10) x t_0))))
      double code(double x, double y, double z) {
      	double t_0 = x * (y * z);
      	double tmp;
      	if (z <= -102000.0) {
      		tmp = t_0;
      	} else if (z <= 3.2e-10) {
      		tmp = x;
      	} 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 = x * (y * z)
          if (z <= (-102000.0d0)) then
              tmp = t_0
          else if (z <= 3.2d-10) then
              tmp = x
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = x * (y * z);
      	double tmp;
      	if (z <= -102000.0) {
      		tmp = t_0;
      	} else if (z <= 3.2e-10) {
      		tmp = x;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = x * (y * z)
      	tmp = 0
      	if z <= -102000.0:
      		tmp = t_0
      	elif z <= 3.2e-10:
      		tmp = x
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(x * Float64(y * z))
      	tmp = 0.0
      	if (z <= -102000.0)
      		tmp = t_0;
      	elseif (z <= 3.2e-10)
      		tmp = x;
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = x * (y * z);
      	tmp = 0.0;
      	if (z <= -102000.0)
      		tmp = t_0;
      	elseif (z <= 3.2e-10)
      		tmp = x;
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -102000.0], t$95$0, If[LessEqual[z, 3.2e-10], x, t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x \cdot \left(y \cdot z\right)\\
      \mathbf{if}\;z \leq -102000:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;z \leq 3.2 \cdot 10^{-10}:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -102000 or 3.19999999999999981e-10 < z

        1. Initial program 92.1%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(y \cdot z\right)}\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(z \cdot \color{blue}{y}\right)\right) \]
          3. *-lowering-*.f6442.0%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{y}\right)\right) \]
        5. Simplified42.0%

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

        if -102000 < z < 3.19999999999999981e-10

        1. Initial program 99.9%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified75.6%

            \[\leadsto \color{blue}{x} \]
        5. Recombined 2 regimes into one program.
        6. Final simplification58.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -102000:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-10}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \end{array} \]
        7. Add Preprocessing

        Alternative 10: 98.0% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ x + \left(x \cdot z\right) \cdot \left(y + -1\right) \end{array} \]
        (FPCore (x y z) :precision binary64 (+ x (* (* x z) (+ y -1.0))))
        double code(double x, double y, double z) {
        	return x + ((x * z) * (y + -1.0));
        }
        
        real(8) function code(x, y, z)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            code = x + ((x * z) * (y + (-1.0d0)))
        end function
        
        public static double code(double x, double y, double z) {
        	return x + ((x * z) * (y + -1.0));
        }
        
        def code(x, y, z):
        	return x + ((x * z) * (y + -1.0))
        
        function code(x, y, z)
        	return Float64(x + Float64(Float64(x * z) * Float64(y + -1.0)))
        end
        
        function tmp = code(x, y, z)
        	tmp = x + ((x * z) * (y + -1.0));
        end
        
        code[x_, y_, z_] := N[(x + N[(N[(x * z), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        x + \left(x \cdot z\right) \cdot \left(y + -1\right)
        \end{array}
        
        Derivation
        1. Initial program 95.9%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto x \cdot \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right)}\right) \]
          2. distribute-rgt-inN/A

            \[\leadsto 1 \cdot x + \color{blue}{\left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x} \]
          3. fma-defineN/A

            \[\leadsto \mathsf{fma}\left(1, \color{blue}{x}, \left(\mathsf{neg}\left(\left(1 - y\right) \cdot z\right)\right) \cdot x\right) \]
          4. distribute-lft-neg-outN/A

            \[\leadsto \mathsf{fma}\left(1, x, \mathsf{neg}\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)\right) \]
          5. fmm-undefN/A

            \[\leadsto 1 \cdot x - \color{blue}{\left(\left(1 - y\right) \cdot z\right) \cdot x} \]
          6. *-lft-identityN/A

            \[\leadsto x - \color{blue}{\left(\left(1 - y\right) \cdot z\right)} \cdot x \]
          7. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(\left(1 - y\right) \cdot z\right), \color{blue}{x}\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(1 - y\right), z\right), x\right)\right) \]
          10. --lowering--.f6495.9%

            \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), z\right), x\right)\right) \]
        4. Applied egg-rr95.9%

          \[\leadsto \color{blue}{x - \left(\left(1 - y\right) \cdot z\right) \cdot x} \]
        5. Step-by-step derivation
          1. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(\left(\left(1 - y\right) \cdot z\right) \cdot x\right)}\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{\_.f64}\left(x, \left(\left(1 - y\right) \cdot \color{blue}{\left(z \cdot x\right)}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\left(1 - y\right), \color{blue}{\left(z \cdot x\right)}\right)\right) \]
          4. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), \left(\color{blue}{z} \cdot x\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), \left(x \cdot \color{blue}{z}\right)\right)\right) \]
          6. *-lowering-*.f6497.8%

            \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, y\right), \mathsf{*.f64}\left(x, \color{blue}{z}\right)\right)\right) \]
        6. Applied egg-rr97.8%

          \[\leadsto \color{blue}{x - \left(1 - y\right) \cdot \left(x \cdot z\right)} \]
        7. Final simplification97.8%

          \[\leadsto x + \left(x \cdot z\right) \cdot \left(y + -1\right) \]
        8. Add Preprocessing

        Alternative 11: 39.3% accurate, 9.0× speedup?

        \[\begin{array}{l} \\ x \end{array} \]
        (FPCore (x y z) :precision binary64 x)
        double code(double x, double y, double z) {
        	return x;
        }
        
        real(8) function code(x, y, z)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            code = x
        end function
        
        public static double code(double x, double y, double z) {
        	return x;
        }
        
        def code(x, y, z):
        	return x
        
        function code(x, y, z)
        	return x
        end
        
        function tmp = code(x, y, z)
        	tmp = x;
        end
        
        code[x_, y_, z_] := x
        
        \begin{array}{l}
        
        \\
        x
        \end{array}
        
        Derivation
        1. Initial program 95.9%

          \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified38.5%

            \[\leadsto \color{blue}{x} \]
          2. Add Preprocessing

          Developer Target 1: 99.7% accurate, 0.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\ t_1 := x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\ \mathbf{if}\;t\_0 < -1.618195973607049 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 < 3.892237649663903 \cdot 10^{+134}:\\ \;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (* x (- 1.0 (* (- 1.0 y) z))))
                  (t_1 (+ x (* (- 1.0 y) (* (- z) x)))))
             (if (< t_0 -1.618195973607049e+50)
               t_1
               (if (< t_0 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) t_1))))
          double code(double x, double y, double z) {
          	double t_0 = x * (1.0 - ((1.0 - y) * z));
          	double t_1 = x + ((1.0 - y) * (-z * x));
          	double tmp;
          	if (t_0 < -1.618195973607049e+50) {
          		tmp = t_1;
          	} else if (t_0 < 3.892237649663903e+134) {
          		tmp = ((x * y) * z) - ((x * z) - x);
          	} 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 = x * (1.0d0 - ((1.0d0 - y) * z))
              t_1 = x + ((1.0d0 - y) * (-z * x))
              if (t_0 < (-1.618195973607049d+50)) then
                  tmp = t_1
              else if (t_0 < 3.892237649663903d+134) then
                  tmp = ((x * y) * z) - ((x * z) - x)
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double t_0 = x * (1.0 - ((1.0 - y) * z));
          	double t_1 = x + ((1.0 - y) * (-z * x));
          	double tmp;
          	if (t_0 < -1.618195973607049e+50) {
          		tmp = t_1;
          	} else if (t_0 < 3.892237649663903e+134) {
          		tmp = ((x * y) * z) - ((x * z) - x);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	t_0 = x * (1.0 - ((1.0 - y) * z))
          	t_1 = x + ((1.0 - y) * (-z * x))
          	tmp = 0
          	if t_0 < -1.618195973607049e+50:
          		tmp = t_1
          	elif t_0 < 3.892237649663903e+134:
          		tmp = ((x * y) * z) - ((x * z) - x)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z)
          	t_0 = Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z)))
          	t_1 = Float64(x + Float64(Float64(1.0 - y) * Float64(Float64(-z) * x)))
          	tmp = 0.0
          	if (t_0 < -1.618195973607049e+50)
          		tmp = t_1;
          	elseif (t_0 < 3.892237649663903e+134)
          		tmp = Float64(Float64(Float64(x * y) * z) - Float64(Float64(x * z) - x));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	t_0 = x * (1.0 - ((1.0 - y) * z));
          	t_1 = x + ((1.0 - y) * (-z * x));
          	tmp = 0.0;
          	if (t_0 < -1.618195973607049e+50)
          		tmp = t_1;
          	elseif (t_0 < 3.892237649663903e+134)
          		tmp = ((x * y) * z) - ((x * z) - x);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(N[(1.0 - y), $MachinePrecision] * N[((-z) * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$0, -1.618195973607049e+50], t$95$1, If[Less[t$95$0, 3.892237649663903e+134], N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] - N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\
          t_1 := x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\
          \mathbf{if}\;t\_0 < -1.618195973607049 \cdot 10^{+50}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t\_0 < 3.892237649663903 \cdot 10^{+134}:\\
          \;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          

          Reproduce

          ?
          herbie shell --seed 2024145 
          (FPCore (x y z)
            :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
            :precision binary64
          
            :alt
            (! :herbie-platform default (if (< (* x (- 1 (* (- 1 y) z))) -161819597360704900000000000000000000000000000000000) (+ x (* (- 1 y) (* (- z) x))) (if (< (* x (- 1 (* (- 1 y) z))) 389223764966390300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1 y) (* (- z) x))))))
          
            (* x (- 1.0 (* (- 1.0 y) z))))