Average Error: 2.4 → 0.4
Time: 46.2s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -7.470109407858776136532553976973323001536 \cdot 10^{104}:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \mathbf{elif}\;x \le 184.3916538293023563710448797792196273804:\\ \;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;x \le -7.470109407858776136532553976973323001536 \cdot 10^{104}:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r26346071 = x;
        double r26346072 = y;
        double r26346073 = sin(r26346072);
        double r26346074 = r26346073 / r26346072;
        double r26346075 = r26346071 * r26346074;
        double r26346076 = z;
        double r26346077 = r26346075 / r26346076;
        return r26346077;
}

double f(double x, double y, double z) {
        double r26346078 = x;
        double r26346079 = -7.470109407858776e+104;
        bool r26346080 = r26346078 <= r26346079;
        double r26346081 = y;
        double r26346082 = sin(r26346081);
        double r26346083 = r26346082 * r26346078;
        double r26346084 = r26346083 / r26346081;
        double r26346085 = z;
        double r26346086 = r26346084 / r26346085;
        double r26346087 = 184.39165382930236;
        bool r26346088 = r26346078 <= r26346087;
        double r26346089 = r26346082 / r26346081;
        double r26346090 = r26346078 / r26346085;
        double r26346091 = r26346089 * r26346090;
        double r26346092 = r26346088 ? r26346091 : r26346086;
        double r26346093 = r26346080 ? r26346086 : r26346092;
        return r26346093;
}

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.4
\[\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 < -7.470109407858776e+104 or 184.39165382930236 < x

    1. Initial program 0.2

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

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

    if -7.470109407858776e+104 < x < 184.39165382930236

    1. Initial program 3.7

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

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity4.2

      \[\leadsto \frac{1}{\color{blue}{1 \cdot \frac{z}{x \cdot \frac{\sin y}{y}}}}\]
    6. Applied add-cube-cbrt4.2

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{1 \cdot \frac{z}{x \cdot \frac{\sin y}{y}}}\]
    7. Applied times-frac4.2

      \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\sqrt[3]{1}}{\frac{z}{x \cdot \frac{\sin y}{y}}}}\]
    8. Simplified4.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -7.470109407858776136532553976973323001536 \cdot 10^{104}:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \mathbf{elif}\;x \le 184.3916538293023563710448797792196273804:\\ \;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \end{array}\]

Reproduce

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