?

Average Accuracy: 94.8% → 98.3%
Time: 6.3s
Precision: binary64
Cost: 968

?

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

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

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 regimes
  2. if (*.f64 y z) < -3.9999999999999997e250

    1. Initial program 39.2%

      \[x \cdot \left(1 - y \cdot z\right) \]
    2. Applied egg-rr0.0%

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

      [Start]39.2

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

      flip3-- [=>]0.0

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

      associate-*r/ [=>]0.0

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

      metadata-eval [=>]0.0

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

      metadata-eval [=>]0.0

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

      distribute-rgt-out [=>]0.0

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

      +-commutative [<=]0.0

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

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

      [Start]0.0

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

      associate-/l* [=>]0.0

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

      \[\leadsto \frac{x}{\color{blue}{\frac{-1}{y \cdot z}}} \]
    5. Simplified44.3%

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

      [Start]39.2

      \[ \frac{x}{\frac{-1}{y \cdot z}} \]

      associate-/r* [=>]44.3

      \[ \frac{x}{\color{blue}{\frac{\frac{-1}{y}}{z}}} \]
    6. Applied egg-rr99.4%

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

      [Start]44.3

      \[ \frac{x}{\frac{\frac{-1}{y}}{z}} \]

      frac-2neg [=>]44.3

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

      associate-/r/ [=>]99.4

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

      distribute-neg-frac [=>]99.4

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

      metadata-eval [=>]99.4

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

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

      [Start]99.4

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

      associate-*l/ [=>]98.7

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

      frac-2neg [=>]98.7

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

      add-sqr-sqrt [=>]0.0

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

      sqrt-unprod [=>]0.3

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

      sqr-neg [=>]0.3

      \[ \frac{-x \cdot \sqrt{\color{blue}{z \cdot z}}}{-\frac{1}{y}} \]

      sqrt-unprod [<=]0.6

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

      add-sqr-sqrt [<=]0.6

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

      distribute-rgt-neg-out [<=]0.6

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

      add-sqr-sqrt [=>]0.0

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

      sqrt-unprod [=>]40.0

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

      sqr-neg [=>]40.0

      \[ \frac{x \cdot \sqrt{\color{blue}{z \cdot z}}}{-\frac{1}{y}} \]

      sqrt-unprod [<=]98.3

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

      add-sqr-sqrt [<=]98.7

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

      distribute-neg-frac [=>]98.7

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

      metadata-eval [=>]98.7

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

    if -3.9999999999999997e250 < (*.f64 y z) < 1.0000000000000001e50

    1. Initial program 99.9%

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

    if 1.0000000000000001e50 < (*.f64 y z)

    1. Initial program 82.9%

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

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

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

      [Start]91.2

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

      mul-1-neg [=>]91.2

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

      associate-*r* [=>]82.9

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

      distribute-lft-neg-in [=>]82.9

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

      distribute-rgt-neg-out [<=]82.9

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

      *-commutative [<=]82.9

      \[ \color{blue}{x \cdot \left(y \cdot \left(-z\right)\right)} \]
    4. Taylor expanded in x around 0 91.2%

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

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

      [Start]91.2

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

      mul-1-neg [=>]91.2

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

      *-commutative [=>]91.2

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

      associate-*l* [=>]90.5

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

      distribute-rgt-neg-in [=>]90.5

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

      *-commutative [=>]90.5

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

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

Alternatives

Alternative 1
Accuracy98.4%
Cost968
\[\begin{array}{l} \mathbf{if}\;y \cdot z \leq -\infty:\\ \;\;\;\;y \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;y \cdot z \leq 10^{+50}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-y\right)\right)\\ \end{array} \]
Alternative 2
Accuracy70.7%
Cost914
\[\begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{-139} \lor \neg \left(z \leq 1.9 \cdot 10^{+48} \lor \neg \left(z \leq 7.5 \cdot 10^{+56}\right) \land z \leq 9 \cdot 10^{+148}\right):\\ \;\;\;\;-\left(y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 3
Accuracy72.3%
Cost912
\[\begin{array}{l} t_0 := y \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{if}\;z \leq -9.5 \cdot 10^{-139}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+54}:\\ \;\;\;\;-\left(y \cdot z\right) \cdot x\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+145}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Accuracy72.4%
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -52000000000000:\\ \;\;\;\;y \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-130}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-y\right)\right)\\ \end{array} \]
Alternative 5
Accuracy60.5%
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023147 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1.0 (* y z))))