Average Error: 9.2 → 0.9
Time: 3.0s
Precision: binary64
\[\frac{x \cdot \left(\frac{x}{y} + 1\right)}{x + 1}\]
\[\left(x \cdot \left(\sqrt[3]{\frac{x}{y} + 1} \cdot \frac{\sqrt[3]{\frac{x}{y} + 1}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right)\right) \cdot \frac{\sqrt[3]{\frac{x}{y} + 1}}{\sqrt[3]{x + 1}}\]
\frac{x \cdot \left(\frac{x}{y} + 1\right)}{x + 1}
\left(x \cdot \left(\sqrt[3]{\frac{x}{y} + 1} \cdot \frac{\sqrt[3]{\frac{x}{y} + 1}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right)\right) \cdot \frac{\sqrt[3]{\frac{x}{y} + 1}}{\sqrt[3]{x + 1}}
double code(double x, double y) {
	return (((double) (x * ((double) ((x / y) + 1.0)))) / ((double) (x + 1.0)));
}
double code(double x, double y) {
	return ((double) (((double) (x * ((double) (((double) cbrt(((double) ((x / y) + 1.0)))) * (((double) cbrt(((double) ((x / y) + 1.0)))) / ((double) (((double) cbrt(((double) (x + 1.0)))) * ((double) cbrt(((double) (x + 1.0))))))))))) * (((double) cbrt(((double) ((x / y) + 1.0)))) / ((double) cbrt(((double) (x + 1.0)))))));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.2
Target0.1
Herbie0.9
\[\frac{x}{1} \cdot \frac{\frac{x}{y} + 1}{x + 1}\]

Derivation

  1. Initial program 9.2

    \[\frac{x \cdot \left(\frac{x}{y} + 1\right)}{x + 1}\]
  2. Simplified0.1

    \[\leadsto \color{blue}{x \cdot \frac{\frac{x}{y} + 1}{x + 1}}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.6

    \[\leadsto x \cdot \frac{\frac{x}{y} + 1}{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}}\]
  5. Applied add-cube-cbrt0.9

    \[\leadsto x \cdot \frac{\color{blue}{\left(\sqrt[3]{\frac{x}{y} + 1} \cdot \sqrt[3]{\frac{x}{y} + 1}\right) \cdot \sqrt[3]{\frac{x}{y} + 1}}}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}\]
  6. Applied times-frac0.9

    \[\leadsto x \cdot \color{blue}{\left(\frac{\sqrt[3]{\frac{x}{y} + 1} \cdot \sqrt[3]{\frac{x}{y} + 1}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \frac{\sqrt[3]{\frac{x}{y} + 1}}{\sqrt[3]{x + 1}}\right)}\]
  7. Applied associate-*r*0.9

    \[\leadsto \color{blue}{\left(x \cdot \frac{\sqrt[3]{\frac{x}{y} + 1} \cdot \sqrt[3]{\frac{x}{y} + 1}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right) \cdot \frac{\sqrt[3]{\frac{x}{y} + 1}}{\sqrt[3]{x + 1}}}\]
  8. Simplified0.9

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

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

Reproduce

herbie shell --seed 2020196 
(FPCore (x y)
  :name "Codec.Picture.Types:toneMapping from JuicyPixels-3.2.6.1"
  :precision binary64

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

  (/ (* x (+ (/ x y) 1.0)) (+ x 1.0)))