Average Error: 15.1 → 2.4
Time: 3.4s
Precision: 64
\[\frac{\left(x \cdot 2\right) \cdot y}{x - y}\]
\[\left(\left(x \cdot 2\right) \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{x - y}}\]
\frac{\left(x \cdot 2\right) \cdot y}{x - y}
\left(\left(x \cdot 2\right) \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{x - y}}
double f(double x, double y) {
        double r498923 = x;
        double r498924 = 2.0;
        double r498925 = r498923 * r498924;
        double r498926 = y;
        double r498927 = r498925 * r498926;
        double r498928 = r498923 - r498926;
        double r498929 = r498927 / r498928;
        return r498929;
}

double f(double x, double y) {
        double r498930 = x;
        double r498931 = 2.0;
        double r498932 = r498930 * r498931;
        double r498933 = y;
        double r498934 = cbrt(r498933);
        double r498935 = r498934 * r498934;
        double r498936 = r498930 - r498933;
        double r498937 = cbrt(r498936);
        double r498938 = r498937 * r498937;
        double r498939 = r498935 / r498938;
        double r498940 = r498932 * r498939;
        double r498941 = r498934 / r498937;
        double r498942 = r498940 * r498941;
        return r498942;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.1
Target0.4
Herbie2.4
\[\begin{array}{l} \mathbf{if}\;x \lt -1.721044263414944729490876394165887012892 \cdot 10^{81}:\\ \;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\ \mathbf{elif}\;x \lt 83645045635564432:\\ \;\;\;\;\frac{x \cdot 2}{\frac{x - y}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot x}{x - y} \cdot y\\ \end{array}\]

Derivation

  1. Initial program 15.1

    \[\frac{\left(x \cdot 2\right) \cdot y}{x - y}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity15.1

    \[\leadsto \frac{\left(x \cdot 2\right) \cdot y}{\color{blue}{1 \cdot \left(x - y\right)}}\]
  4. Applied times-frac7.2

    \[\leadsto \color{blue}{\frac{x \cdot 2}{1} \cdot \frac{y}{x - y}}\]
  5. Simplified7.2

    \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot \frac{y}{x - y}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt8.4

    \[\leadsto \left(x \cdot 2\right) \cdot \frac{y}{\color{blue}{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \sqrt[3]{x - y}}}\]
  8. Applied add-cube-cbrt7.8

    \[\leadsto \left(x \cdot 2\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \sqrt[3]{x - y}}\]
  9. Applied times-frac7.8

    \[\leadsto \left(x \cdot 2\right) \cdot \color{blue}{\left(\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{x - y}}\right)}\]
  10. Applied associate-*r*2.4

    \[\leadsto \color{blue}{\left(\left(x \cdot 2\right) \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{x - y}}}\]
  11. Final simplification2.4

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

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, B"
  :precision binary64

  :herbie-target
  (if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))

  (/ (* (* x 2) y) (- x y)))