Average Error: 0.0 → 0.0
Time: 37.9s
Precision: 64
\[x + y \cdot \left(z - x\right)\]
\[x \cdot \left(1 - y\right) - \left(-z\right) \cdot y\]
x + y \cdot \left(z - x\right)
x \cdot \left(1 - y\right) - \left(-z\right) \cdot y
double f(double x, double y, double z) {
        double r12777 = x;
        double r12778 = y;
        double r12779 = z;
        double r12780 = r12779 - r12777;
        double r12781 = r12778 * r12780;
        double r12782 = r12777 + r12781;
        return r12782;
}

double f(double x, double y, double z) {
        double r12783 = x;
        double r12784 = 1.0;
        double r12785 = y;
        double r12786 = r12784 - r12785;
        double r12787 = r12783 * r12786;
        double r12788 = z;
        double r12789 = -r12788;
        double r12790 = r12789 * r12785;
        double r12791 = r12787 - r12790;
        return r12791;
}

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

Derivation

  1. Initial program 0.0

    \[x + y \cdot \left(z - x\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{x - y \cdot \left(x - z\right)}\]
  3. Using strategy rm
  4. Applied sub-neg0.0

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

    \[\leadsto x - \color{blue}{\left(x \cdot y + \left(-z\right) \cdot y\right)}\]
  6. Applied associate--r+0.0

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

    \[\leadsto \color{blue}{\left(x - y \cdot x\right)} - \left(-z\right) \cdot y\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.0

    \[\leadsto \left(\color{blue}{1 \cdot x} - y \cdot x\right) - \left(-z\right) \cdot y\]
  10. Applied distribute-rgt-out--0.0

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

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

Reproduce

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