Average Error: 5.7 → 0.2
Time: 9.4s
Precision: 64
\[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\]
\[\frac{1}{\frac{y \cdot \frac{3}{3 - x}}{1 - x}}\]
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\frac{1}{\frac{y \cdot \frac{3}{3 - x}}{1 - x}}
double f(double x, double y) {
        double r692196 = 1.0;
        double r692197 = x;
        double r692198 = r692196 - r692197;
        double r692199 = 3.0;
        double r692200 = r692199 - r692197;
        double r692201 = r692198 * r692200;
        double r692202 = y;
        double r692203 = r692202 * r692199;
        double r692204 = r692201 / r692203;
        return r692204;
}

double f(double x, double y) {
        double r692205 = 1.0;
        double r692206 = y;
        double r692207 = 3.0;
        double r692208 = x;
        double r692209 = r692207 - r692208;
        double r692210 = r692207 / r692209;
        double r692211 = r692206 * r692210;
        double r692212 = 1.0;
        double r692213 = r692212 - r692208;
        double r692214 = r692211 / r692213;
        double r692215 = r692205 / r692214;
        return r692215;
}

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

Derivation

  1. Initial program 5.7

    \[\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. Simplified0.1

    \[\leadsto \frac{1 - x}{\color{blue}{y \cdot \frac{3}{3 - x}}}\]
  5. Using strategy rm
  6. Applied clear-num0.2

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

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

Reproduce

herbie shell --seed 2020047 +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)))