Average Error: 5.9 → 0.1
Time: 10.2s
Precision: 64
\[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\]
\[\frac{\frac{1 - x}{y}}{\frac{3}{3 - x}}\]
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\frac{\frac{1 - x}{y}}{\frac{3}{3 - x}}
double f(double x, double y) {
        double r545194 = 1.0;
        double r545195 = x;
        double r545196 = r545194 - r545195;
        double r545197 = 3.0;
        double r545198 = r545197 - r545195;
        double r545199 = r545196 * r545198;
        double r545200 = y;
        double r545201 = r545200 * r545197;
        double r545202 = r545199 / r545201;
        return r545202;
}

double f(double x, double y) {
        double r545203 = 1.0;
        double r545204 = x;
        double r545205 = r545203 - r545204;
        double r545206 = y;
        double r545207 = r545205 / r545206;
        double r545208 = 3.0;
        double r545209 = r545208 - r545204;
        double r545210 = r545208 / r545209;
        double r545211 = r545207 / r545210;
        return r545211;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.9
Target0.1
Herbie0.1
\[\frac{1 - x}{y} \cdot \frac{3 - x}{3}\]

Derivation

  1. Initial program 5.9

    \[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\]
  2. Using strategy rm
  3. Applied associate-/l*0.3

    \[\leadsto \color{blue}{\frac{1 - x}{\frac{y \cdot 3}{3 - x}}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity0.3

    \[\leadsto \frac{1 - x}{\frac{y \cdot 3}{\color{blue}{1 \cdot \left(3 - x\right)}}}\]
  6. Applied times-frac0.1

    \[\leadsto \frac{1 - x}{\color{blue}{\frac{y}{1} \cdot \frac{3}{3 - x}}}\]
  7. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{1 - x}{\frac{y}{1}}}{\frac{3}{3 - x}}}\]
  8. Simplified0.1

    \[\leadsto \frac{\color{blue}{\frac{1 - x}{y}}}{\frac{3}{3 - x}}\]
  9. Final simplification0.1

    \[\leadsto \frac{\frac{1 - x}{y}}{\frac{3}{3 - x}}\]

Reproduce

herbie shell --seed 2019212 
(FPCore (x y)
  :name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"
  :precision binary64

  :herbie-target
  (* (/ (- 1 x) y) (/ (- 3 x) 3))

  (/ (* (- 1 x) (- 3 x)) (* y 3)))