Average Error: 5.3 → 0.2
Time: 12.2s
Precision: 64
\[\frac{\left(1.0 - x\right) \cdot \left(3.0 - x\right)}{y \cdot 3.0}\]
\[\left(1.0 - 0.3333333333333333 \cdot x\right) \cdot \frac{1.0 - x}{y}\]
\frac{\left(1.0 - x\right) \cdot \left(3.0 - x\right)}{y \cdot 3.0}
\left(1.0 - 0.3333333333333333 \cdot x\right) \cdot \frac{1.0 - x}{y}
double f(double x, double y) {
        double r32155545 = 1.0;
        double r32155546 = x;
        double r32155547 = r32155545 - r32155546;
        double r32155548 = 3.0;
        double r32155549 = r32155548 - r32155546;
        double r32155550 = r32155547 * r32155549;
        double r32155551 = y;
        double r32155552 = r32155551 * r32155548;
        double r32155553 = r32155550 / r32155552;
        return r32155553;
}

double f(double x, double y) {
        double r32155554 = 1.0;
        double r32155555 = 0.3333333333333333;
        double r32155556 = x;
        double r32155557 = r32155555 * r32155556;
        double r32155558 = r32155554 - r32155557;
        double r32155559 = r32155554 - r32155556;
        double r32155560 = y;
        double r32155561 = r32155559 / r32155560;
        double r32155562 = r32155558 * r32155561;
        return r32155562;
}

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

Derivation

  1. Initial program 5.3

    \[\frac{\left(1.0 - x\right) \cdot \left(3.0 - x\right)}{y \cdot 3.0}\]
  2. Using strategy rm
  3. Applied times-frac0.1

    \[\leadsto \color{blue}{\frac{1.0 - x}{y} \cdot \frac{3.0 - x}{3.0}}\]
  4. Taylor expanded around 0 0.2

    \[\leadsto \frac{1.0 - x}{y} \cdot \color{blue}{\left(1.0 - 0.3333333333333333 \cdot x\right)}\]
  5. Final simplification0.2

    \[\leadsto \left(1.0 - 0.3333333333333333 \cdot x\right) \cdot \frac{1.0 - x}{y}\]

Reproduce

herbie shell --seed 2019164 
(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)))