Average Error: 15.1 → 0.4
Time: 11.5s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -2.8729605916325777 \cdot 10^{+267}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -2.7507759442519827 \cdot 10^{-276}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.437974108594 \cdot 10^{-312}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le 2.1335813366195736 \cdot 10^{+166}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -2.8729605916325777 \cdot 10^{+267}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;\frac{y}{z} \le -2.7507759442519827 \cdot 10^{-276}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

\mathbf{elif}\;\frac{y}{z} \le 1.437974108594 \cdot 10^{-312}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\

\mathbf{elif}\;\frac{y}{z} \le 2.1335813366195736 \cdot 10^{+166}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\

\end{array}
double f(double x, double y, double z, double t) {
        double r19401506 = x;
        double r19401507 = y;
        double r19401508 = z;
        double r19401509 = r19401507 / r19401508;
        double r19401510 = t;
        double r19401511 = r19401509 * r19401510;
        double r19401512 = r19401511 / r19401510;
        double r19401513 = r19401506 * r19401512;
        return r19401513;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r19401514 = y;
        double r19401515 = z;
        double r19401516 = r19401514 / r19401515;
        double r19401517 = -2.8729605916325777e+267;
        bool r19401518 = r19401516 <= r19401517;
        double r19401519 = x;
        double r19401520 = r19401519 * r19401514;
        double r19401521 = r19401520 / r19401515;
        double r19401522 = -2.7507759442519827e-276;
        bool r19401523 = r19401516 <= r19401522;
        double r19401524 = r19401516 * r19401519;
        double r19401525 = 1.437974108594e-312;
        bool r19401526 = r19401516 <= r19401525;
        double r19401527 = 1.0;
        double r19401528 = r19401515 / r19401520;
        double r19401529 = r19401527 / r19401528;
        double r19401530 = 2.1335813366195736e+166;
        bool r19401531 = r19401516 <= r19401530;
        double r19401532 = r19401527 / r19401515;
        double r19401533 = r19401532 * r19401520;
        double r19401534 = r19401531 ? r19401524 : r19401533;
        double r19401535 = r19401526 ? r19401529 : r19401534;
        double r19401536 = r19401523 ? r19401524 : r19401535;
        double r19401537 = r19401518 ? r19401521 : r19401536;
        return r19401537;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.1
Target1.5
Herbie0.4
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \lt -1.20672205123045 \cdot 10^{+245}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt -5.907522236933906 \cdot 10^{-275}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt 5.658954423153415 \cdot 10^{-65}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt 2.0087180502407133 \cdot 10^{+217}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if (/ y z) < -2.8729605916325777e+267

    1. Initial program 52.6

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified0.3

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around 0 0.4

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

    if -2.8729605916325777e+267 < (/ y z) < -2.7507759442519827e-276 or 1.437974108594e-312 < (/ y z) < 2.1335813366195736e+166

    1. Initial program 9.2

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified8.3

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around 0 8.3

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
    6. Applied times-frac0.2

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

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

    if -2.7507759442519827e-276 < (/ y z) < 1.437974108594e-312

    1. Initial program 20.4

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified0.1

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around 0 0.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied clear-num0.5

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

    if 2.1335813366195736e+166 < (/ y z)

    1. Initial program 37.3

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified1.1

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around 0 1.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -2.8729605916325777 \cdot 10^{+267}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -2.7507759442519827 \cdot 10^{-276}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.437974108594 \cdot 10^{-312}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot y}}\\ \mathbf{elif}\;\frac{y}{z} \le 2.1335813366195736 \cdot 10^{+166}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019158 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, B"

  :herbie-target
  (if (< (/ (* (/ y z) t) t) -1.20672205123045e+245) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) -5.907522236933906e-275) (* x (/ y z)) (if (< (/ (* (/ y z) t) t) 5.658954423153415e-65) (/ y (/ z x)) (if (< (/ (* (/ y z) t) t) 2.0087180502407133e+217) (* x (/ y z)) (/ (* y x) z)))))

  (* x (/ (* (/ y z) t) t)))