Average Error: 0 → 0
Time: 1.3s
Precision: 64
\[2 \cdot \left(a - b\right)\]
\[\left(a - b\right) \cdot 2\]
2 \cdot \left(a - b\right)
\left(a - b\right) \cdot 2
double f(double a, double b) {
        double r24493818 = 2.0;
        double r24493819 = a;
        double r24493820 = b;
        double r24493821 = r24493819 - r24493820;
        double r24493822 = r24493818 * r24493821;
        return r24493822;
}

double f(double a, double b) {
        double r24493823 = a;
        double r24493824 = b;
        double r24493825 = r24493823 - r24493824;
        double r24493826 = 2.0;
        double r24493827 = r24493825 * r24493826;
        return r24493827;
}

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0

    \[2 \cdot \left(a - b\right)\]
  2. Final simplification0

    \[\leadsto \left(a - b\right) \cdot 2\]

Reproduce

herbie shell --seed 1 
(FPCore (a b)
  :name "2*(a-b)"
  (* 2 (- a b)))