Average Error: 0.0 → 0.0
Time: 3.7s
Precision: binary64
Cost: 576
\[x + y \cdot \left(z - x\right)\]
\[x + \left(y \cdot z - x \cdot y\right)\]
x + y \cdot \left(z - x\right)
x + \left(y \cdot z - x \cdot y\right)
(FPCore (x y z) :precision binary64 (+ x (* y (- z x))))
(FPCore (x y z) :precision binary64 (+ x (- (* y z) (* 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 + ((y * z) - (x * y));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.0
Cost448
\[x + y \cdot \left(z - x\right)\]
Alternative 2
Error1.1
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -89818618282.91447 \lor \neg \left(y \leq 0.9956953243829788\right):\\ \;\;\;\;y \cdot \left(z - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array}\]
Alternative 3
Error12.5
Cost1604
\[\begin{array}{l} \mathbf{if}\;y \leq -3.8679192498212615 \cdot 10^{-05}:\\ \;\;\;\;y \cdot \left(z - x\right)\\ \mathbf{elif}\;y \leq 4.0371723615036114 \cdot 10^{-143}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{elif}\;y \leq 3.6303759550639167 \cdot 10^{-104}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq 1.7944673035702988 \cdot 10^{-35}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z - x\right)\\ \end{array}\]
Alternative 4
Error12.6
Cost1604
\[\begin{array}{l} \mathbf{if}\;y \leq -2.682925795823981 \cdot 10^{-06}:\\ \;\;\;\;y \cdot \left(z - x\right)\\ \mathbf{elif}\;y \leq 2.1044493989060077 \cdot 10^{-142}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.3027110144778568 \cdot 10^{-104}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq 1.9636970965493405 \cdot 10^{-31}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z - x\right)\\ \end{array}\]
Alternative 5
Error24.1
Cost785
\[\begin{array}{l} \mathbf{if}\;y \leq -2.682925795823981 \cdot 10^{-06} \lor \neg \left(y \leq 2.294200945127263 \cdot 10^{-142} \lor \neg \left(y \leq 8.893464099454243 \cdot 10^{-102}\right) \land y \leq 3.00433268063754 \cdot 10^{-38}\right):\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 6
Error34.7
Cost64
\[x\]
Alternative 7
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[x + y \cdot \left(z - x\right)\]
  2. Using strategy rm
  3. Applied sub-neg_binary64_710.0

    \[\leadsto x + y \cdot \color{blue}{\left(z + \left(-x\right)\right)}\]
  4. Applied distribute-rgt-in_binary64_280.0

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

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

    \[\leadsto x + \left(y \cdot z + \color{blue}{y \cdot \left(-x\right)}\right)\]
  7. Using strategy rm
  8. Applied distribute-rgt-neg-out_binary64_380.0

    \[\leadsto x + \left(y \cdot z + \color{blue}{\left(-y \cdot x\right)}\right)\]
  9. Applied unsub-neg_binary64_720.0

    \[\leadsto x + \color{blue}{\left(y \cdot z - y \cdot x\right)}\]
  10. Simplified0.0

    \[\leadsto \color{blue}{x + \left(y \cdot z - x \cdot y\right)}\]
  11. Final simplification0.0

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

Reproduce

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