Average Error: 0.0 → 0.0
Time: 9.5s
Precision: 64
\[x + y \cdot \left(z - x\right)\]
\[x + \left(z \cdot y + \left(-x\right) \cdot y\right)\]
x + y \cdot \left(z - x\right)
x + \left(z \cdot y + \left(-x\right) \cdot y\right)
double f(double x, double y, double z) {
        double r16357 = x;
        double r16358 = y;
        double r16359 = z;
        double r16360 = r16359 - r16357;
        double r16361 = r16358 * r16360;
        double r16362 = r16357 + r16361;
        return r16362;
}

double f(double x, double y, double z) {
        double r16363 = x;
        double r16364 = z;
        double r16365 = y;
        double r16366 = r16364 * r16365;
        double r16367 = -r16363;
        double r16368 = r16367 * r16365;
        double r16369 = r16366 + r16368;
        double r16370 = r16363 + r16369;
        return r16370;
}

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. Using strategy rm
  3. Applied sub-neg0.0

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

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

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

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

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

Reproduce

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