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

Percentage Accurate: 96.0% → 97.5%
Time: 9.1s
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: 96.0% 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.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.5e103

    1. Initial program 98.6%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]

    if 1.5e103 < z

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

Alternative 2: 66.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(-x\right)\\ t_1 := y \cdot \left(z \cdot x\right)\\ \mathbf{if}\;z \leq -2.95 \cdot 10^{+184}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{+38}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-30}:\\ \;\;\;\;x \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 2900000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+143} \lor \neg \left(z \leq 9 \cdot 10^{+200}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- x))) (t_1 (* y (* z x))))
   (if (<= z -2.95e+184)
     t_0
     (if (<= z -2.4e+97)
       t_1
       (if (<= z -1.65e+38)
         t_0
         (if (<= z -2.4e-30)
           (* x (* z y))
           (if (<= z 2900000.0)
             x
             (if (or (<= z 7e+143) (not (<= z 9e+200))) t_0 t_1))))))))
double code(double x, double y, double z) {
	double t_0 = z * -x;
	double t_1 = y * (z * x);
	double tmp;
	if (z <= -2.95e+184) {
		tmp = t_0;
	} else if (z <= -2.4e+97) {
		tmp = t_1;
	} else if (z <= -1.65e+38) {
		tmp = t_0;
	} else if (z <= -2.4e-30) {
		tmp = x * (z * y);
	} else if (z <= 2900000.0) {
		tmp = x;
	} else if ((z <= 7e+143) || !(z <= 9e+200)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * -x
    t_1 = y * (z * x)
    if (z <= (-2.95d+184)) then
        tmp = t_0
    else if (z <= (-2.4d+97)) then
        tmp = t_1
    else if (z <= (-1.65d+38)) then
        tmp = t_0
    else if (z <= (-2.4d-30)) then
        tmp = x * (z * y)
    else if (z <= 2900000.0d0) then
        tmp = x
    else if ((z <= 7d+143) .or. (.not. (z <= 9d+200))) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * -x;
	double t_1 = y * (z * x);
	double tmp;
	if (z <= -2.95e+184) {
		tmp = t_0;
	} else if (z <= -2.4e+97) {
		tmp = t_1;
	} else if (z <= -1.65e+38) {
		tmp = t_0;
	} else if (z <= -2.4e-30) {
		tmp = x * (z * y);
	} else if (z <= 2900000.0) {
		tmp = x;
	} else if ((z <= 7e+143) || !(z <= 9e+200)) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * -x
	t_1 = y * (z * x)
	tmp = 0
	if z <= -2.95e+184:
		tmp = t_0
	elif z <= -2.4e+97:
		tmp = t_1
	elif z <= -1.65e+38:
		tmp = t_0
	elif z <= -2.4e-30:
		tmp = x * (z * y)
	elif z <= 2900000.0:
		tmp = x
	elif (z <= 7e+143) or not (z <= 9e+200):
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(-x))
	t_1 = Float64(y * Float64(z * x))
	tmp = 0.0
	if (z <= -2.95e+184)
		tmp = t_0;
	elseif (z <= -2.4e+97)
		tmp = t_1;
	elseif (z <= -1.65e+38)
		tmp = t_0;
	elseif (z <= -2.4e-30)
		tmp = Float64(x * Float64(z * y));
	elseif (z <= 2900000.0)
		tmp = x;
	elseif ((z <= 7e+143) || !(z <= 9e+200))
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * -x;
	t_1 = y * (z * x);
	tmp = 0.0;
	if (z <= -2.95e+184)
		tmp = t_0;
	elseif (z <= -2.4e+97)
		tmp = t_1;
	elseif (z <= -1.65e+38)
		tmp = t_0;
	elseif (z <= -2.4e-30)
		tmp = x * (z * y);
	elseif (z <= 2900000.0)
		tmp = x;
	elseif ((z <= 7e+143) || ~((z <= 9e+200)))
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-x)), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.95e+184], t$95$0, If[LessEqual[z, -2.4e+97], t$95$1, If[LessEqual[z, -1.65e+38], t$95$0, If[LessEqual[z, -2.4e-30], N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2900000.0], x, If[Or[LessEqual[z, 7e+143], N[Not[LessEqual[z, 9e+200]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{+97}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.65 \cdot 10^{+38}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \left(z \cdot y\right)\\

\mathbf{elif}\;z \leq 2900000:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7 \cdot 10^{+143} \lor \neg \left(z \leq 9 \cdot 10^{+200}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.9500000000000001e184 or -2.4e97 < z < -1.65e38 or 2.9e6 < z < 7.00000000000000017e143 or 8.99999999999999939e200 < z

    1. Initial program 95.5%

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

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

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

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

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

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

    if -2.9500000000000001e184 < z < -2.4e97 or 7.00000000000000017e143 < z < 8.99999999999999939e200

    1. Initial program 82.3%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. add-cube-cbrt81.8%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{x \cdot \left(1 - \left(1 - y\right) \cdot z\right)}\right)}^{3}} \]
    3. Applied egg-rr81.9%

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

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

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

      \[\leadsto {\left(\sqrt[3]{\color{blue}{x \cdot \left(z \cdot y\right)}}\right)}^{3} \]
    7. Step-by-step derivation
      1. rem-cube-cbrt57.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(z \cdot x\right) \cdot y} \]
    8. Applied egg-rr82.4%

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

    if -1.65e38 < z < -2.39999999999999985e-30

    1. Initial program 99.5%

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

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

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

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

    if -2.39999999999999985e-30 < z < 2.9e6

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.95 \cdot 10^{+184}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+97}:\\ \;\;\;\;y \cdot \left(z \cdot x\right)\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{+38}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-30}:\\ \;\;\;\;x \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 2900000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+143} \lor \neg \left(z \leq 9 \cdot 10^{+200}\right):\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z \cdot x\right)\\ \end{array} \]

Alternative 3: 65.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(-x\right)\\ \mathbf{if}\;z \leq -7.8 \cdot 10^{+38}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 2900000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+157} \lor \neg \left(z \leq 9 \cdot 10^{+200}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- x))))
   (if (<= z -7.8e+38)
     t_0
     (if (<= z -3.4e-15)
       (* x (* z y))
       (if (<= z 2900000.0)
         x
         (if (or (<= z 8.8e+157) (not (<= z 9e+200))) t_0 (* z (* x y))))))))
double code(double x, double y, double z) {
	double t_0 = z * -x;
	double tmp;
	if (z <= -7.8e+38) {
		tmp = t_0;
	} else if (z <= -3.4e-15) {
		tmp = x * (z * y);
	} else if (z <= 2900000.0) {
		tmp = x;
	} else if ((z <= 8.8e+157) || !(z <= 9e+200)) {
		tmp = t_0;
	} else {
		tmp = z * (x * y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = z * -x
    if (z <= (-7.8d+38)) then
        tmp = t_0
    else if (z <= (-3.4d-15)) then
        tmp = x * (z * y)
    else if (z <= 2900000.0d0) then
        tmp = x
    else if ((z <= 8.8d+157) .or. (.not. (z <= 9d+200))) then
        tmp = t_0
    else
        tmp = z * (x * y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * -x;
	double tmp;
	if (z <= -7.8e+38) {
		tmp = t_0;
	} else if (z <= -3.4e-15) {
		tmp = x * (z * y);
	} else if (z <= 2900000.0) {
		tmp = x;
	} else if ((z <= 8.8e+157) || !(z <= 9e+200)) {
		tmp = t_0;
	} else {
		tmp = z * (x * y);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * -x
	tmp = 0
	if z <= -7.8e+38:
		tmp = t_0
	elif z <= -3.4e-15:
		tmp = x * (z * y)
	elif z <= 2900000.0:
		tmp = x
	elif (z <= 8.8e+157) or not (z <= 9e+200):
		tmp = t_0
	else:
		tmp = z * (x * y)
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(-x))
	tmp = 0.0
	if (z <= -7.8e+38)
		tmp = t_0;
	elseif (z <= -3.4e-15)
		tmp = Float64(x * Float64(z * y));
	elseif (z <= 2900000.0)
		tmp = x;
	elseif ((z <= 8.8e+157) || !(z <= 9e+200))
		tmp = t_0;
	else
		tmp = Float64(z * Float64(x * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * -x;
	tmp = 0.0;
	if (z <= -7.8e+38)
		tmp = t_0;
	elseif (z <= -3.4e-15)
		tmp = x * (z * y);
	elseif (z <= 2900000.0)
		tmp = x;
	elseif ((z <= 8.8e+157) || ~((z <= 9e+200)))
		tmp = t_0;
	else
		tmp = z * (x * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-x)), $MachinePrecision]}, If[LessEqual[z, -7.8e+38], t$95$0, If[LessEqual[z, -3.4e-15], N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2900000.0], x, If[Or[LessEqual[z, 8.8e+157], N[Not[LessEqual[z, 9e+200]], $MachinePrecision]], t$95$0, N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 2900000:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 8.8 \cdot 10^{+157} \lor \neg \left(z \leq 9 \cdot 10^{+200}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.80000000000000047e38 or 2.9e6 < z < 8.8000000000000005e157 or 8.99999999999999939e200 < z

    1. Initial program 94.5%

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

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

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

        \[\leadsto \color{blue}{-x \cdot z} \]
      2. distribute-rgt-neg-in70.1%

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

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

    if -7.80000000000000047e38 < z < -3.4e-15

    1. Initial program 99.5%

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

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

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

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

    if -3.4e-15 < z < 2.9e6

    1. Initial program 100.0%

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

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

    if 8.8000000000000005e157 < z < 8.99999999999999939e200

    1. Initial program 68.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+38}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 2900000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+157} \lor \neg \left(z \leq 9 \cdot 10^{+200}\right):\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot y\right)\\ \end{array} \]

Alternative 4: 94.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+29} \lor \neg \left(y \leq 2.85 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot \left(1 + z \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.2000000000000001e29 or 2.8500000000000002e-5 < y

    1. Initial program 93.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. *-commutative93.0%

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

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e29 < y < 2.8500000000000002e-5

    1. Initial program 99.3%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - x \cdot z} \]
    4. Simplified98.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+29} \lor \neg \left(y \leq 2.85 \cdot 10^{-5}\right):\\ \;\;\;\;x \cdot \left(1 + z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot x\\ \end{array} \]

Alternative 5: 98.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 92.9%

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. *-commutative99.9%

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

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

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

        \[\leadsto x \cdot \left(1 - \frac{z \cdot \left(\color{blue}{1} - y \cdot y\right)}{1 + y}\right) \]
    3. Applied egg-rr81.5%

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

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

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

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

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

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

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

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

Alternative 6: 98.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 94.8%

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

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

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

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

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

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

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

    if -1.05000000000000004 < z < 1

    1. Initial program 99.9%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. *-commutative99.9%

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

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

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

        \[\leadsto x \cdot \left(1 - \frac{z \cdot \left(\color{blue}{1} - y \cdot y\right)}{1 + y}\right) \]
    3. Applied egg-rr81.5%

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

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

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

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

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

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

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

    if 1 < z

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

Alternative 7: 65.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -8 \cdot 10^{-24}:\\
\;\;\;\;x \cdot \left(z \cdot y\right)\\

\mathbf{elif}\;z \leq 2900000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.59999999999999993e38 or 2.9e6 < z

    1. Initial program 92.4%

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

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

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

        \[\leadsto \color{blue}{-x \cdot z} \]
      2. distribute-rgt-neg-in66.4%

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

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

    if -1.59999999999999993e38 < z < -7.99999999999999939e-24

    1. Initial program 99.5%

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

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

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

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

    if -7.99999999999999939e-24 < z < 2.9e6

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+38}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-24}:\\ \;\;\;\;x \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 2900000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \end{array} \]

Alternative 8: 84.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 5.6 \cdot 10^{+50}:\\
\;\;\;\;x - z \cdot x\\

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


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

    1. Initial program 89.0%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. add-cube-cbrt87.7%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{x \cdot \left(1 - \left(1 - y\right) \cdot z\right)}\right)}^{3}} \]
    3. Applied egg-rr87.7%

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

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

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y\right)} \]
    6. Simplified63.2%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{x \cdot \left(z \cdot y\right)}}\right)}^{3} \]
    7. Step-by-step derivation
      1. rem-cube-cbrt63.8%

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

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

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

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

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

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

    if -6.0000000000000002e28 < y < 5.5999999999999996e50

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if 5.5999999999999996e50 < y

    1. Initial program 95.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+28}:\\ \;\;\;\;y \cdot \left(z \cdot x\right)\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+50}:\\ \;\;\;\;x - z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot y\right)\\ \end{array} \]

Alternative 9: 65.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-11} \lor \neg \left(z \leq 2900000\right):\\
\;\;\;\;z \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.3999999999999999e-11 or 2.9e6 < z

    1. Initial program 92.9%

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

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

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

        \[\leadsto \color{blue}{-x \cdot z} \]
      2. distribute-rgt-neg-in62.1%

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

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

    if -3.3999999999999999e-11 < z < 2.9e6

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{-11} \lor \neg \left(z \leq 2900000\right):\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 38.7% 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 96.6%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification42.6%

    \[\leadsto x \]

Developer target: 99.8% 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 2023271 
(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))))