Average Error: 0.0 → 0.0
Time: 16.0s
Precision: 64
\[x + y \cdot \left(z - x\right)\]
\[\left(z \cdot y + x\right) + y \cdot \left(-x\right)\]
x + y \cdot \left(z - x\right)
\left(z \cdot y + x\right) + y \cdot \left(-x\right)
double f(double x, double y, double z) {
        double r23155 = x;
        double r23156 = y;
        double r23157 = z;
        double r23158 = r23157 - r23155;
        double r23159 = r23156 * r23158;
        double r23160 = r23155 + r23159;
        return r23160;
}

double f(double x, double y, double z) {
        double r23161 = z;
        double r23162 = y;
        double r23163 = r23161 * r23162;
        double r23164 = x;
        double r23165 = r23163 + r23164;
        double r23166 = -r23164;
        double r23167 = r23162 * r23166;
        double r23168 = r23165 + r23167;
        return r23168;
}

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. Simplified0.0

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

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

Reproduce

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