Average Error: 2.7 → 3.3
Time: 6.6s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\frac{x}{\frac{z}{\frac{\sin y}{y}}}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\frac{x}{\frac{z}{\frac{\sin y}{y}}}
double f(double x, double y, double z) {
        double r489366 = x;
        double r489367 = y;
        double r489368 = sin(r489367);
        double r489369 = r489368 / r489367;
        double r489370 = r489366 * r489369;
        double r489371 = z;
        double r489372 = r489370 / r489371;
        return r489372;
}

double f(double x, double y, double z) {
        double r489373 = x;
        double r489374 = z;
        double r489375 = y;
        double r489376 = sin(r489375);
        double r489377 = r489376 / r489375;
        double r489378 = r489374 / r489377;
        double r489379 = r489373 / r489378;
        return r489379;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.7
Target0.3
Herbie3.3
\[\begin{array}{l} \mathbf{if}\;z \lt -4.21737202034271466 \cdot 10^{-29}:\\ \;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\ \mathbf{elif}\;z \lt 4.44670236911381103 \cdot 10^{64}:\\ \;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\ \end{array}\]

Derivation

  1. Initial program 2.7

    \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
  2. Using strategy rm
  3. Applied associate-/l*3.3

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}}\]
  4. Final simplification3.3

    \[\leadsto \frac{x}{\frac{z}{\frac{\sin y}{y}}}\]

Reproduce

herbie shell --seed 2020081 
(FPCore (x y z)
  :name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< z -4.2173720203427147e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))

  (/ (* x (/ (sin y) y)) z))