Average Error: 5.9 → 0.3
Time: 3.3s
Precision: 64
\[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\]
\[\left(1 - x\right) \cdot \frac{1}{\frac{y \cdot 3}{3 - x}}\]
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\left(1 - x\right) \cdot \frac{1}{\frac{y \cdot 3}{3 - x}}
double f(double x, double y) {
        double r562042 = 1.0;
        double r562043 = x;
        double r562044 = r562042 - r562043;
        double r562045 = 3.0;
        double r562046 = r562045 - r562043;
        double r562047 = r562044 * r562046;
        double r562048 = y;
        double r562049 = r562048 * r562045;
        double r562050 = r562047 / r562049;
        return r562050;
}

double f(double x, double y) {
        double r562051 = 1.0;
        double r562052 = x;
        double r562053 = r562051 - r562052;
        double r562054 = 1.0;
        double r562055 = y;
        double r562056 = 3.0;
        double r562057 = r562055 * r562056;
        double r562058 = r562056 - r562052;
        double r562059 = r562057 / r562058;
        double r562060 = r562054 / r562059;
        double r562061 = r562053 * r562060;
        return r562061;
}

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.3
\[\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 div-inv0.3

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

    \[\leadsto \left(1 - x\right) \cdot \frac{1}{\frac{y \cdot 3}{3 - x}}\]

Reproduce

herbie shell --seed 2020024 +o rules:numerics
(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)))