?

Average Accuracy: 100.0% → 100.0%
Time: 5.7s
Precision: binary64
Cost: 576

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 100.0%

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

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

    [Start]100.0

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

    sub-neg [=>]100.0

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

    distribute-rgt-in [=>]100.0

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

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

Alternatives

Alternative 1
Accuracy63.2%
Cost916
\[\begin{array}{l} t_0 := y \cdot \left(-x\right)\\ \mathbf{if}\;y \leq -4.5 \cdot 10^{+63}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq -108000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.35 \cdot 10^{-39}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-10}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{+129}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Accuracy80.9%
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-63} \lor \neg \left(y \leq 3.1 \cdot 10^{-10}\right):\\ \;\;\;\;y \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 3
Accuracy98.7%
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -5.4 \lor \neg \left(y \leq 1\right):\\ \;\;\;\;y \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]
Alternative 4
Accuracy100.0%
Cost576
\[z \cdot y + x \cdot \left(1 - y\right) \]
Alternative 5
Accuracy55.5%
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -2.55 \cdot 10^{-45}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]
Alternative 6
Accuracy100.0%
Cost448
\[x + y \cdot \left(z - x\right) \]
Alternative 7
Accuracy46.1%
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023151 
(FPCore (x y z)
  :name "SynthBasics:oscSampleBasedAux from YampaSynth-0.2"
  :precision binary64
  (+ x (* y (- z x))))