Average Error: 2.4 → 0.2
Time: 56.4s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -3.709201162717754895449491456213181044763 \cdot 10^{48}:\\ \;\;\;\;\frac{\frac{1}{\frac{y}{\sin y}} \cdot x}{z}\\ \mathbf{elif}\;x \le 1567.526035614710735899279825389385223389:\\ \;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{y}{\sin y}} \cdot x}{z}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;x \le -3.709201162717754895449491456213181044763 \cdot 10^{48}:\\
\;\;\;\;\frac{\frac{1}{\frac{y}{\sin y}} \cdot x}{z}\\

\mathbf{elif}\;x \le 1567.526035614710735899279825389385223389:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\

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

\end{array}
double f(double x, double y, double z) {
        double r19752338 = x;
        double r19752339 = y;
        double r19752340 = sin(r19752339);
        double r19752341 = r19752340 / r19752339;
        double r19752342 = r19752338 * r19752341;
        double r19752343 = z;
        double r19752344 = r19752342 / r19752343;
        return r19752344;
}

double f(double x, double y, double z) {
        double r19752345 = x;
        double r19752346 = -3.709201162717755e+48;
        bool r19752347 = r19752345 <= r19752346;
        double r19752348 = 1.0;
        double r19752349 = y;
        double r19752350 = sin(r19752349);
        double r19752351 = r19752349 / r19752350;
        double r19752352 = r19752348 / r19752351;
        double r19752353 = r19752352 * r19752345;
        double r19752354 = z;
        double r19752355 = r19752353 / r19752354;
        double r19752356 = 1567.5260356147107;
        bool r19752357 = r19752345 <= r19752356;
        double r19752358 = r19752345 / r19752354;
        double r19752359 = r19752358 / r19752351;
        double r19752360 = r19752357 ? r19752359 : r19752355;
        double r19752361 = r19752347 ? r19752355 : r19752360;
        return r19752361;
}

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.4
Target0.3
Herbie0.2
\[\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 < -3.709201162717755e+48 or 1567.5260356147107 < x

    1. Initial program 0.2

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

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

    if -3.709201162717755e+48 < x < 1567.5260356147107

    1. Initial program 3.9

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

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

      \[\leadsto \color{blue}{\left(x \cdot \frac{1}{\frac{y}{\sin y}}\right) \cdot \frac{1}{z}}\]
    6. Using strategy rm
    7. Applied un-div-inv4.0

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{\sin y}}} \cdot \frac{1}{z}\]
    8. Applied associate-*l/0.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -3.709201162717754895449491456213181044763 \cdot 10^{48}:\\ \;\;\;\;\frac{\frac{1}{\frac{y}{\sin y}} \cdot x}{z}\\ \mathbf{elif}\;x \le 1567.526035614710735899279825389385223389:\\ \;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{y}{\sin y}} \cdot x}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019200 +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))