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

Percentage Accurate: 95.8% → 98.9%
Time: 8.7s
Alternatives: 10
Speedup: 0.8×

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 10 alternatives:

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

Initial Program: 95.8% 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: 98.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0021:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\

\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x + x \cdot \left(y \cdot z\right)\\

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


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

    1. Initial program 90.6%

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

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutative89.0%

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

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

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

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

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

    if -0.00209999999999999987 < z < 1

    1. Initial program 100.0%

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

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

      \[\leadsto x + \color{blue}{x \cdot \left(y \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

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

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

    if 1 < z

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(x \cdot y + \left(-x\right)\right)} \]
      3. fma-def99.3%

        \[\leadsto z \cdot \color{blue}{\mathsf{fma}\left(x, y, -x\right)} \]
      4. fma-neg99.3%

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

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

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

Alternative 2: 64.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := z \cdot \left(-x\right)\\
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+219}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{+186}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{-62}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+41}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3499999999999999e219 or -3.6000000000000002e186 < z < -1 or 1.35e41 < z

    1. Initial program 92.1%

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

      \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
    3. Step-by-step derivation
      1. sub-neg65.0%

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-z\right)\right)} \]
      2. distribute-rgt-in65.0%

        \[\leadsto \color{blue}{1 \cdot x + \left(-z\right) \cdot x} \]
      3. *-lft-identity65.0%

        \[\leadsto \color{blue}{x} + \left(-z\right) \cdot x \]
      4. distribute-lft-neg-out65.0%

        \[\leadsto x + \color{blue}{\left(-z \cdot x\right)} \]
      5. *-commutative65.0%

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

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

      \[\leadsto \color{blue}{x - x \cdot z} \]
    5. Taylor expanded in z around inf 64.7%

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

        \[\leadsto \color{blue}{-x \cdot z} \]
      2. *-commutative64.7%

        \[\leadsto -\color{blue}{z \cdot x} \]
      3. distribute-rgt-neg-in64.7%

        \[\leadsto \color{blue}{z \cdot \left(-x\right)} \]
    7. Simplified64.7%

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

    if -1.3499999999999999e219 < z < -3.6000000000000002e186 or 1.19999999999999992e-62 < z < 1.35e41

    1. Initial program 90.0%

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right)} \]
    3. Step-by-step derivation
      1. *-commutative64.9%

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

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

    if -1 < z < 1.19999999999999992e-62

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+219}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+186}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{elif}\;z \leq -1:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-62}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \end{array} \]

Alternative 3: 97.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(1 - y\right) \cdot z \leq -\infty:\\ \;\;\;\;z \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y \cdot z - z\right) - -1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* (- 1.0 y) z) (- INFINITY))
   (* z (* y x))
   (* x (- (- (* y z) z) -1.0))))
double code(double x, double y, double z) {
	double tmp;
	if (((1.0 - y) * z) <= -((double) INFINITY)) {
		tmp = z * (y * x);
	} else {
		tmp = x * (((y * z) - z) - -1.0);
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double tmp;
	if (((1.0 - y) * z) <= -Double.POSITIVE_INFINITY) {
		tmp = z * (y * x);
	} else {
		tmp = x * (((y * z) - z) - -1.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if ((1.0 - y) * z) <= -math.inf:
		tmp = z * (y * x)
	else:
		tmp = x * (((y * z) - z) - -1.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(Float64(1.0 - y) * z) <= Float64(-Inf))
		tmp = Float64(z * Float64(y * x));
	else
		tmp = Float64(x * Float64(Float64(Float64(y * z) - z) - -1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (((1.0 - y) * z) <= -Inf)
		tmp = z * (y * x);
	else
		tmp = x * (((y * z) - z) - -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], (-Infinity)], N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(N[(y * z), $MachinePrecision] - z), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left(1 - y\right) \cdot z \leq -\infty:\\
\;\;\;\;z \cdot \left(y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 1 y) z) < -inf.0

    1. Initial program 50.6%

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

      \[\leadsto x \cdot \left(1 - \color{blue}{\left(z + -1 \cdot \left(y \cdot z\right)\right)}\right) \]
    3. Step-by-step derivation
      1. mul-1-neg50.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot y} \]
      3. *-commutative99.8%

        \[\leadsto \color{blue}{\left(z \cdot x\right)} \cdot y \]
      4. associate-*r*99.9%

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

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

    if -inf.0 < (*.f64 (-.f64 1 y) z)

    1. Initial program 98.4%

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

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

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(z - y \cdot z\right)}\right) \]
      3. *-commutative98.4%

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

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

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

Alternative 4: 97.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(1 - y\right) \cdot z \leq -\infty:\\ \;\;\;\;z \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* (- 1.0 y) z) (- INFINITY))
   (* z (* y x))
   (* x (+ 1.0 (* z (+ y -1.0))))))
double code(double x, double y, double z) {
	double tmp;
	if (((1.0 - y) * z) <= -((double) INFINITY)) {
		tmp = z * (y * x);
	} else {
		tmp = x * (1.0 + (z * (y + -1.0)));
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double tmp;
	if (((1.0 - y) * z) <= -Double.POSITIVE_INFINITY) {
		tmp = z * (y * x);
	} else {
		tmp = x * (1.0 + (z * (y + -1.0)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if ((1.0 - y) * z) <= -math.inf:
		tmp = z * (y * x)
	else:
		tmp = x * (1.0 + (z * (y + -1.0)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(Float64(1.0 - y) * z) <= Float64(-Inf))
		tmp = Float64(z * Float64(y * x));
	else
		tmp = Float64(x * Float64(1.0 + Float64(z * Float64(y + -1.0))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (((1.0 - y) * z) <= -Inf)
		tmp = z * (y * x);
	else
		tmp = x * (1.0 + (z * (y + -1.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], (-Infinity)], N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left(1 - y\right) \cdot z \leq -\infty:\\
\;\;\;\;z \cdot \left(y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 1 y) z) < -inf.0

    1. Initial program 50.6%

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

      \[\leadsto x \cdot \left(1 - \color{blue}{\left(z + -1 \cdot \left(y \cdot z\right)\right)}\right) \]
    3. Step-by-step derivation
      1. mul-1-neg50.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot y} \]
      3. *-commutative99.8%

        \[\leadsto \color{blue}{\left(z \cdot x\right)} \cdot y \]
      4. associate-*r*99.9%

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

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

    if -inf.0 < (*.f64 (-.f64 1 y) z)

    1. Initial program 98.4%

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

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

Alternative 5: 65.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot x\right)\\
t_1 := z \cdot \left(-x\right)\\
\mathbf{if}\;z \leq -9.4 \cdot 10^{+185}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.36 \cdot 10^{-62}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{+99}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.39999999999999945e185 or 1.35999999999999999e-62 < z < 1.7499999999999999e99

    1. Initial program 86.9%

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

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y \cdot z\right)}\right) \]
      2. distribute-lft-neg-out58.0%

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y\right) \cdot z}\right) \]
      3. *-commutative58.0%

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

      \[\leadsto x \cdot \left(1 - \color{blue}{z \cdot \left(-y\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative58.0%

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y\right) \cdot z}\right) \]
      2. cancel-sign-sub58.0%

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

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

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y + 1\right)} \]
      5. add-cube-cbrt57.5%

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

        \[\leadsto x \cdot \left(\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \left(\sqrt[3]{z} \cdot y\right)} + 1\right) \]
      7. fma-def57.5%

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(\sqrt[3]{z} \cdot \sqrt[3]{z}, \sqrt[3]{z} \cdot y, 1\right)} \]
      8. pow257.5%

        \[\leadsto x \cdot \mathsf{fma}\left(\color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}, \sqrt[3]{z} \cdot y, 1\right) \]
    6. Applied egg-rr57.5%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{z}\right)}^{2}, \sqrt[3]{z} \cdot y, 1\right)} \]
    7. Taylor expanded in y around inf 52.2%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. pow-base-152.2%

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

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

        \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]
      4. associate-*r*68.4%

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

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

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

    if -9.39999999999999945e185 < z < -1 or 1.7499999999999999e99 < z

    1. Initial program 94.7%

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

      \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
    3. Step-by-step derivation
      1. sub-neg67.7%

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-z\right)\right)} \]
      2. distribute-rgt-in67.7%

        \[\leadsto \color{blue}{1 \cdot x + \left(-z\right) \cdot x} \]
      3. *-lft-identity67.7%

        \[\leadsto \color{blue}{x} + \left(-z\right) \cdot x \]
      4. distribute-lft-neg-out67.7%

        \[\leadsto x + \color{blue}{\left(-z \cdot x\right)} \]
      5. *-commutative67.7%

        \[\leadsto x + \left(-\color{blue}{x \cdot z}\right) \]
      6. unsub-neg67.7%

        \[\leadsto \color{blue}{x - x \cdot z} \]
    4. Simplified67.7%

      \[\leadsto \color{blue}{x - x \cdot z} \]
    5. Taylor expanded in z around inf 67.3%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg67.3%

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

        \[\leadsto -\color{blue}{z \cdot x} \]
      3. distribute-rgt-neg-in67.3%

        \[\leadsto \color{blue}{z \cdot \left(-x\right)} \]
    7. Simplified67.3%

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

    if -1 < z < 1.35999999999999999e-62

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.4 \cdot 10^{+185}:\\ \;\;\;\;y \cdot \left(z \cdot x\right)\\ \mathbf{elif}\;z \leq -1:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-62}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+99}:\\ \;\;\;\;y \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \end{array} \]

Alternative 6: 86.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-23} \lor \neg \left(z \leq 1.36 \cdot 10^{-62}\right):\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.69999999999999985e-23 or 1.35999999999999999e-62 < z

    1. Initial program 92.1%

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

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutative87.7%

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

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

        \[\leadsto z \cdot \left(\color{blue}{\left(y + \left(-1\right)\right)} \cdot x\right) \]
      4. metadata-eval95.5%

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

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

    if -2.69999999999999985e-23 < z < 1.35999999999999999e-62

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-z\right)\right)} \]
      2. distribute-rgt-in81.9%

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

        \[\leadsto \color{blue}{x} + \left(-z\right) \cdot x \]
      4. distribute-lft-neg-out81.9%

        \[\leadsto x + \color{blue}{\left(-z \cdot x\right)} \]
      5. *-commutative81.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{-23} \lor \neg \left(z \leq 1.36 \cdot 10^{-62}\right):\\ \;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot x\\ \end{array} \]

Alternative 7: 86.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 3.1 \cdot 10^{-63}:\\
\;\;\;\;x - z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.7000000000000003e-23

    1. Initial program 91.3%

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

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

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

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

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

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

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

    if -9.7000000000000003e-23 < z < 3.09999999999999984e-63

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-z\right)\right)} \]
      2. distribute-rgt-in81.9%

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

        \[\leadsto \color{blue}{x} + \left(-z\right) \cdot x \]
      4. distribute-lft-neg-out81.9%

        \[\leadsto x + \color{blue}{\left(-z \cdot x\right)} \]
      5. *-commutative81.9%

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

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

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

    if 3.09999999999999984e-63 < z

    1. Initial program 92.8%

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

      \[\leadsto \color{blue}{x \cdot \left(z \cdot \left(y - 1\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutative88.0%

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\mathsf{fma}\left(x, y, -x\right)} \]
      4. fma-neg95.2%

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

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

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

Alternative 8: 85.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+52} \lor \neg \left(y \leq 2.1 \cdot 10^{+59}\right):\\
\;\;\;\;y \cdot \left(z \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.6e52 or 2.09999999999999984e59 < y

    1. Initial program 87.1%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 - \color{blue}{\left(-y\right) \cdot z}\right) \]
      2. cancel-sign-sub87.1%

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

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

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y + 1\right)} \]
      5. add-cube-cbrt86.2%

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

        \[\leadsto x \cdot \left(\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \left(\sqrt[3]{z} \cdot y\right)} + 1\right) \]
      7. fma-def86.3%

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(\sqrt[3]{z} \cdot \sqrt[3]{z}, \sqrt[3]{z} \cdot y, 1\right)} \]
      8. pow286.3%

        \[\leadsto x \cdot \mathsf{fma}\left(\color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}, \sqrt[3]{z} \cdot y, 1\right) \]
    6. Applied egg-rr86.3%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{z}\right)}^{2}, \sqrt[3]{z} \cdot y, 1\right)} \]
    7. Taylor expanded in y around inf 70.7%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \left(x \cdot \left(y \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. pow-base-170.7%

        \[\leadsto \color{blue}{1} \cdot \left(x \cdot \left(y \cdot z\right)\right) \]
      2. *-commutative70.7%

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

        \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right)} \]
      4. associate-*r*81.9%

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

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

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

    if -2.6e52 < y < 2.09999999999999984e59

    1. Initial program 100.0%

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-z\right)\right)} \]
      2. distribute-rgt-in94.0%

        \[\leadsto \color{blue}{1 \cdot x + \left(-z\right) \cdot x} \]
      3. *-lft-identity94.0%

        \[\leadsto \color{blue}{x} + \left(-z\right) \cdot x \]
      4. distribute-lft-neg-out94.0%

        \[\leadsto x + \color{blue}{\left(-z \cdot x\right)} \]
      5. *-commutative94.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+52} \lor \neg \left(y \leq 2.1 \cdot 10^{+59}\right):\\ \;\;\;\;y \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot x\\ \end{array} \]

Alternative 9: 64.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 4.9\right):\\
\;\;\;\;z \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1 or 4.9000000000000004 < z

    1. Initial program 91.1%

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

      \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
    3. Step-by-step derivation
      1. sub-neg59.1%

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(-z\right)\right)} \]
      2. distribute-rgt-in59.1%

        \[\leadsto \color{blue}{1 \cdot x + \left(-z\right) \cdot x} \]
      3. *-lft-identity59.1%

        \[\leadsto \color{blue}{x} + \left(-z\right) \cdot x \]
      4. distribute-lft-neg-out59.1%

        \[\leadsto x + \color{blue}{\left(-z \cdot x\right)} \]
      5. *-commutative59.1%

        \[\leadsto x + \left(-\color{blue}{x \cdot z}\right) \]
      6. unsub-neg59.1%

        \[\leadsto \color{blue}{x - x \cdot z} \]
    4. Simplified59.1%

      \[\leadsto \color{blue}{x - x \cdot z} \]
    5. Taylor expanded in z around inf 58.5%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg58.5%

        \[\leadsto \color{blue}{-x \cdot z} \]
      2. *-commutative58.5%

        \[\leadsto -\color{blue}{z \cdot x} \]
      3. distribute-rgt-neg-in58.5%

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

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

    if -1 < z < 4.9000000000000004

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 4.9\right):\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 38.0% 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.2%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification36.5%

    \[\leadsto x \]

Developer target: 99.7% accurate, 0.3× 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 2023287 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
  :precision binary64

  :herbie-target
  (if (< (* x (- 1.0 (* (- 1.0 y) z))) -1.618195973607049e+50) (+ x (* (- 1.0 y) (* (- z) x))) (if (< (* x (- 1.0 (* (- 1.0 y) z))) 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1.0 y) (* (- z) x)))))

  (* x (- 1.0 (* (- 1.0 y) z))))