Average Error: 0.0 → 0.0
Time: 9.1s
Precision: 64
\[x + y \cdot \left(z - x\right)\]
\[x \cdot \left(-y\right) + \left(z \cdot y + x\right)\]
x + y \cdot \left(z - x\right)
x \cdot \left(-y\right) + \left(z \cdot y + x\right)
double f(double x, double y, double z) {
        double r458007 = x;
        double r458008 = y;
        double r458009 = z;
        double r458010 = r458009 - r458007;
        double r458011 = r458008 * r458010;
        double r458012 = r458007 + r458011;
        return r458012;
}

double f(double x, double y, double z) {
        double r458013 = x;
        double r458014 = y;
        double r458015 = -r458014;
        double r458016 = r458013 * r458015;
        double r458017 = z;
        double r458018 = r458017 * r458014;
        double r458019 = r458018 + r458013;
        double r458020 = r458016 + r458019;
        return r458020;
}

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. Applied associate-+r+0.0

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

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

Reproduce

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