Average Error: 0.0 → 0.0
Time: 9.1s
Precision: 64
\[x + y \cdot \left(z - x\right)\]
\[\left(x + y \cdot z\right) + y \cdot \left(-x\right)\]
x + y \cdot \left(z - x\right)
\left(x + y \cdot z\right) + y \cdot \left(-x\right)
double f(double x, double y, double z) {
        double r12875 = x;
        double r12876 = y;
        double r12877 = z;
        double r12878 = r12877 - r12875;
        double r12879 = r12876 * r12878;
        double r12880 = r12875 + r12879;
        return r12880;
}

double f(double x, double y, double z) {
        double r12881 = x;
        double r12882 = y;
        double r12883 = z;
        double r12884 = r12882 * r12883;
        double r12885 = r12881 + r12884;
        double r12886 = -r12881;
        double r12887 = r12882 * r12886;
        double r12888 = r12885 + r12887;
        return r12888;
}

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 \left(x + y \cdot z\right) + y \cdot \left(-x\right)\]

Reproduce

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