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

Percentage Accurate: 96.3% → 98.0%
Time: 9.5s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 96.3% 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.0% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 98.5%

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

    if 5e16 < z

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

Alternative 2: 64.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq 3.5 \cdot 10^{-14}:\\
\;\;\;\;x\\

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

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


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

    1. Initial program 91.5%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. sub-neg91.5%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{0 - \left(1 - y\right)}, 1\right) \]
      9. associate--r-91.5%

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{\left(0 - 1\right) + y}, 1\right) \]
      10. metadata-eval91.5%

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{-1} + y, 1\right) \]
      11. +-commutative91.5%

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

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(z, y + -1, 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine91.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - x \cdot z} \]
    12. Simplified64.6%

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

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

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

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

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

    if -1 < z < 3.5000000000000002e-14

    1. Initial program 99.9%

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

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

    if 3.5000000000000002e-14 < z < 3.39999999999999986e131

    1. Initial program 96.6%

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

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

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

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

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

Alternative 3: 95.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 91.9%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \left(-\color{blue}{\left(-z \cdot y\right)}\right)\right) \]
      3. remove-double-neg91.8%

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

        \[\leadsto x \cdot \color{blue}{\left(z \cdot y + 1\right)} \]
    7. Applied egg-rr91.8%

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

    if -0.94999999999999996 < y < 1

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(z, -\left(1 - y\right), 1\right)} \]
      8. neg-sub0100.0%

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{0 - \left(1 - y\right)}, 1\right) \]
      9. associate--r-100.0%

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{\left(0 - 1\right) + y}, 1\right) \]
      10. metadata-eval100.0%

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{-1} + y, 1\right) \]
      11. +-commutative100.0%

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

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(z, y + -1, 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - x \cdot z} \]
    12. Simplified99.1%

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

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

Alternative 4: 98.7% accurate, 0.5× 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.5%

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

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

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

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

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

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

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

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

    if -1 < z < 1

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\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} \]
  5. Add Preprocessing

Alternative 5: 83.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+69} \lor \neg \left(y \leq 17000000000\right):\\
\;\;\;\;x \cdot \left(z \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.06000000000000004e69 or 1.7e10 < y

    1. Initial program 92.0%

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

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

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

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

    if -1.06000000000000004e69 < y < 1.7e10

    1. Initial program 99.3%

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

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

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

Alternative 6: 84.3% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 94.1%

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

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

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

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

    if -6.0000000000000004e64 < y < 2.2e10

    1. Initial program 99.3%

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

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

    if 2.2e10 < y

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

Alternative 7: 84.5% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 94.1%

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

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

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

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

    if -5.2999999999999999e63 < y < 2.7e10

    1. Initial program 99.3%

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

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

    if 2.7e10 < y

    1. Initial program 90.3%

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

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

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

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

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

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

Alternative 8: 84.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 25000000000:\\
\;\;\;\;x - x \cdot z\\

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


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

    1. Initial program 94.1%

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

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

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

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

    if -2.09999999999999991e65 < y < 2.5e10

    1. Initial program 99.3%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. sub-neg99.3%

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

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

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

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

        \[\leadsto x \cdot \left(\left(-\color{blue}{z \cdot \left(1 - y\right)}\right) + 1\right) \]
      6. distribute-rgt-neg-in99.3%

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{0 - \left(1 - y\right)}, 1\right) \]
      9. associate--r-99.3%

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

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{-1} + y, 1\right) \]
      11. +-commutative99.3%

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

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(z, y + -1, 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - x \cdot z} \]
    12. Simplified96.1%

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

    if 2.5e10 < y

    1. Initial program 90.3%

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

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

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

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

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

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

Alternative 9: 64.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\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 1.0))) (* z (- x)) x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.0) || !(z <= 1.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 <= (-1.0d0)) .or. (.not. (z <= 1.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 <= -1.0) || !(z <= 1.0)) {
		tmp = z * -x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -1.0) or not (z <= 1.0):
		tmp = z * -x
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -1.0) || !(z <= 1.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 <= -1.0) || ~((z <= 1.0)))
		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, 1.0]], $MachinePrecision]], N[(z * (-x)), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\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 1 < z

    1. Initial program 92.5%

      \[x \cdot \left(1 - \left(1 - y\right) \cdot z\right) \]
    2. Step-by-step derivation
      1. sub-neg92.5%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{0 - \left(1 - y\right)}, 1\right) \]
      9. associate--r-92.5%

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{\left(0 - 1\right) + y}, 1\right) \]
      10. metadata-eval92.5%

        \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{-1} + y, 1\right) \]
      11. +-commutative92.5%

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

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(z, y + -1, 1\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine92.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - x \cdot z} \]
    12. Simplified58.0%

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(-z\right)} \]
    15. Simplified56.8%

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

    if -1 < z < 1

    1. Initial program 99.9%

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

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

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

Alternative 10: 97.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(z, -\left(1 - y\right), 1\right)} \]
    8. neg-sub096.2%

      \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{0 - \left(1 - y\right)}, 1\right) \]
    9. associate--r-96.2%

      \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{\left(0 - 1\right) + y}, 1\right) \]
    10. metadata-eval96.2%

      \[\leadsto x \cdot \mathsf{fma}\left(z, \color{blue}{-1} + y, 1\right) \]
    11. +-commutative96.2%

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

    \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(z, y + -1, 1\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-undefine96.2%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 38.6% 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.2%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification38.1%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 99.7% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\
t_1 := x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\
\mathbf{if}\;t\_0 < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 < 3.892237649663903 \cdot 10^{+134}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024067 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
  :precision binary64

  :alt
  (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))))