Average Error: 15.1 → 0.7
Time: 35.0s
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.167382686214397895425941397509630236779 \cdot 10^{231}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.827587823355642407973457381841440310715 \cdot 10^{-156}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.053250369059781787110723173910298691639 \cdot 10^{-123}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 1.111565981439738552177075156972483526402 \cdot 10^{232}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -1.167382686214397895425941397509630236779 \cdot 10^{231}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

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

\mathbf{elif}\;\frac{y}{z} \le 1.111565981439738552177075156972483526402 \cdot 10^{232}:\\
\;\;\;\;\frac{y}{z} \cdot x\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r30221332 = x;
        double r30221333 = y;
        double r30221334 = z;
        double r30221335 = r30221333 / r30221334;
        double r30221336 = t;
        double r30221337 = r30221335 * r30221336;
        double r30221338 = r30221337 / r30221336;
        double r30221339 = r30221332 * r30221338;
        return r30221339;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r30221340 = y;
        double r30221341 = z;
        double r30221342 = r30221340 / r30221341;
        double r30221343 = -1.1673826862143979e+231;
        bool r30221344 = r30221342 <= r30221343;
        double r30221345 = x;
        double r30221346 = r30221345 * r30221340;
        double r30221347 = r30221346 / r30221341;
        double r30221348 = -1.8275878233556424e-156;
        bool r30221349 = r30221342 <= r30221348;
        double r30221350 = r30221342 * r30221345;
        double r30221351 = 1.0532503690597818e-123;
        bool r30221352 = r30221342 <= r30221351;
        double r30221353 = r30221345 / r30221341;
        double r30221354 = r30221353 * r30221340;
        double r30221355 = 1.1115659814397386e+232;
        bool r30221356 = r30221342 <= r30221355;
        double r30221357 = r30221356 ? r30221350 : r30221354;
        double r30221358 = r30221352 ? r30221354 : r30221357;
        double r30221359 = r30221349 ? r30221350 : r30221358;
        double r30221360 = r30221344 ? r30221347 : r30221359;
        return r30221360;
}

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.7
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \lt -1.206722051230450047215521150762600712224 \cdot 10^{245}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt -5.90752223693390632993316700759382836344 \cdot 10^{-275}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt 5.658954423153415216825328199697215652986 \cdot 10^{-65}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \lt 2.008718050240713347941382056648619307142 \cdot 10^{217}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ y z) < -1.1673826862143979e+231

    1. Initial program 50.5

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

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

      \[\leadsto y \cdot \frac{x}{\color{blue}{1 \cdot z}}\]
    5. Applied add-cube-cbrt1.9

      \[\leadsto y \cdot \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{1 \cdot z}\]
    6. Applied times-frac1.9

      \[\leadsto y \cdot \color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \frac{\sqrt[3]{x}}{z}\right)}\]
    7. Applied associate-*r*1.9

      \[\leadsto \color{blue}{\left(y \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1}\right) \cdot \frac{\sqrt[3]{x}}{z}}\]
    8. Simplified1.9

      \[\leadsto \color{blue}{\left(\left(y \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \frac{\sqrt[3]{x}}{z}\]
    9. Using strategy rm
    10. Applied associate-*r/1.9

      \[\leadsto \color{blue}{\frac{\left(\left(y \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}{z}}\]
    11. Simplified0.7

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

    if -1.1673826862143979e+231 < (/ y z) < -1.8275878233556424e-156 or 1.0532503690597818e-123 < (/ y z) < 1.1115659814397386e+232

    1. Initial program 8.2

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

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

      \[\leadsto y \cdot \frac{x}{\color{blue}{1 \cdot z}}\]
    5. Applied add-cube-cbrt12.0

      \[\leadsto y \cdot \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{1 \cdot z}\]
    6. Applied times-frac12.0

      \[\leadsto y \cdot \color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1} \cdot \frac{\sqrt[3]{x}}{z}\right)}\]
    7. Applied associate-*r*9.1

      \[\leadsto \color{blue}{\left(y \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1}\right) \cdot \frac{\sqrt[3]{x}}{z}}\]
    8. Simplified9.1

      \[\leadsto \color{blue}{\left(\left(y \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \frac{\sqrt[3]{x}}{z}\]
    9. Using strategy rm
    10. Applied associate-*r/10.6

      \[\leadsto \color{blue}{\frac{\left(\left(y \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}{z}}\]
    11. Simplified9.7

      \[\leadsto \frac{\color{blue}{x \cdot y}}{z}\]
    12. Using strategy rm
    13. Applied *-un-lft-identity9.7

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

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

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

    if -1.8275878233556424e-156 < (/ y z) < 1.0532503690597818e-123 or 1.1115659814397386e+232 < (/ y z)

    1. Initial program 20.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.167382686214397895425941397509630236779 \cdot 10^{231}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.827587823355642407973457381841440310715 \cdot 10^{-156}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 1.053250369059781787110723173910298691639 \cdot 10^{-123}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 1.111565981439738552177075156972483526402 \cdot 10^{232}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Reproduce

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