Average Error: 2.7 → 3.3
Time: 6.7s
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 r470403 = x;
        double r470404 = y;
        double r470405 = sin(r470404);
        double r470406 = r470405 / r470404;
        double r470407 = r470403 * r470406;
        double r470408 = z;
        double r470409 = r470407 / r470408;
        return r470409;
}

double f(double x, double y, double z) {
        double r470410 = x;
        double r470411 = z;
        double r470412 = y;
        double r470413 = sin(r470412);
        double r470414 = r470413 / r470412;
        double r470415 = r470411 / r470414;
        double r470416 = r470410 / r470415;
        return r470416;
}

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 +o rules:numerics
(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))