Average Error: 2.6 → 2.6
Time: 11.9s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\frac{x \cdot \frac{\sin y}{y}}{z}
double f(double x, double y, double z) {
        double r342029 = x;
        double r342030 = y;
        double r342031 = sin(r342030);
        double r342032 = r342031 / r342030;
        double r342033 = r342029 * r342032;
        double r342034 = z;
        double r342035 = r342033 / r342034;
        return r342035;
}

double f(double x, double y, double z) {
        double r342036 = x;
        double r342037 = y;
        double r342038 = sin(r342037);
        double r342039 = r342038 / r342037;
        double r342040 = r342036 * r342039;
        double r342041 = z;
        double r342042 = r342040 / r342041;
        return r342042;
}

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.6
Target0.3
Herbie2.6
\[\begin{array}{l} \mathbf{if}\;z \lt -4.217372020342714661850238929213415773451 \cdot 10^{-29}:\\ \;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\ \mathbf{elif}\;z \lt 4.446702369113811028051510715777703865332 \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. Split input into 2 regimes
  2. if (* x (/ (sin y) y)) < 1.669669962309958e-201

    1. Initial program 3.9

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}}\]
    4. Using strategy rm
    5. Applied div-inv2.6

      \[\leadsto \frac{x}{\color{blue}{z \cdot \frac{1}{\frac{\sin y}{y}}}}\]
    6. Simplified2.6

      \[\leadsto \frac{x}{z \cdot \color{blue}{\frac{y}{\sin y}}}\]

    if 1.669669962309958e-201 < (* x (/ (sin y) y))

    1. Initial program 0.2

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
    2. Using strategy rm
    3. Applied div-inv0.4

      \[\leadsto \color{blue}{\left(x \cdot \frac{\sin y}{y}\right) \cdot \frac{1}{z}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.6

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

Reproduce

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

  :herbie-target
  (if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))

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