Average Error: 2.8 → 1.5
Time: 15.5s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -7744513270.8935337066650390625:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;x \le -7744513270.8935337066650390625:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\

\end{array}
double f(double x, double y, double z) {
        double r21423312 = x;
        double r21423313 = y;
        double r21423314 = sin(r21423313);
        double r21423315 = r21423314 / r21423313;
        double r21423316 = r21423312 * r21423315;
        double r21423317 = z;
        double r21423318 = r21423316 / r21423317;
        return r21423318;
}

double f(double x, double y, double z) {
        double r21423319 = x;
        double r21423320 = -7744513270.893534;
        bool r21423321 = r21423319 <= r21423320;
        double r21423322 = y;
        double r21423323 = sin(r21423322);
        double r21423324 = r21423323 * r21423319;
        double r21423325 = r21423324 / r21423322;
        double r21423326 = z;
        double r21423327 = r21423325 / r21423326;
        double r21423328 = r21423323 / r21423322;
        double r21423329 = r21423328 / r21423326;
        double r21423330 = r21423319 * r21423329;
        double r21423331 = r21423321 ? r21423327 : r21423330;
        return r21423331;
}

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.8
Target0.3
Herbie1.5
\[\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 < -7744513270.893534

    1. Initial program 0.2

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
    2. Using strategy rm
    3. Applied clear-num0.2

      \[\leadsto \frac{x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}}}{z}\]
    4. Taylor expanded around inf 0.3

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

    if -7744513270.893534 < x

    1. Initial program 3.5

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity3.5

      \[\leadsto \frac{x \cdot \frac{\sin y}{y}}{\color{blue}{1 \cdot z}}\]
    4. Applied times-frac1.9

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{\frac{\sin y}{y}}{z}}\]
    5. Simplified1.9

      \[\leadsto \color{blue}{x} \cdot \frac{\frac{\sin y}{y}}{z}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -7744513270.8935337066650390625:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$ctanh from linear-1.19.1.3"

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

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