Average Error: 5.8 → 0.1
Time: 12.3s
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 r43131140 = 1.0;
        double r43131141 = x;
        double r43131142 = r43131140 - r43131141;
        double r43131143 = 3.0;
        double r43131144 = r43131143 - r43131141;
        double r43131145 = r43131142 * r43131144;
        double r43131146 = y;
        double r43131147 = r43131146 * r43131143;
        double r43131148 = r43131145 / r43131147;
        return r43131148;
}

double f(double x, double y) {
        double r43131149 = 1.0;
        double r43131150 = x;
        double r43131151 = r43131149 - r43131150;
        double r43131152 = y;
        double r43131153 = r43131151 / r43131152;
        double r43131154 = 3.0;
        double r43131155 = r43131154 - r43131150;
        double r43131156 = r43131154 / r43131155;
        double r43131157 = r43131153 / r43131156;
        return r43131157;
}

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.8
Target0.1
Herbie0.1
\[\frac{1 - x}{y} \cdot \frac{3 - x}{3}\]

Derivation

  1. Initial program 5.8

    \[\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 2019171 
(FPCore (x y)
  :name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"

  :herbie-target
  (* (/ (- 1.0 x) y) (/ (- 3.0 x) 3.0))

  (/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))