Average Error: 14.4 → 0.5
Time: 4.8m
Precision: 64
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -9.916325328902394 \cdot 10^{+225}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -8.08619711399183 \cdot 10^{-156}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 4.2595672029945 \cdot 10^{-318}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 2.0905090728700514 \cdot 10^{+191}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]
x \cdot \frac{\frac{y}{z} \cdot t}{t}
\begin{array}{l}
\mathbf{if}\;\frac{y}{z} \le -9.916325328902394 \cdot 10^{+225}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r32881195 = x;
        double r32881196 = y;
        double r32881197 = z;
        double r32881198 = r32881196 / r32881197;
        double r32881199 = t;
        double r32881200 = r32881198 * r32881199;
        double r32881201 = r32881200 / r32881199;
        double r32881202 = r32881195 * r32881201;
        return r32881202;
}

double f(double x, double y, double z, double __attribute__((unused)) t) {
        double r32881203 = y;
        double r32881204 = z;
        double r32881205 = r32881203 / r32881204;
        double r32881206 = -9.916325328902394e+225;
        bool r32881207 = r32881205 <= r32881206;
        double r32881208 = x;
        double r32881209 = r32881208 / r32881204;
        double r32881210 = r32881203 * r32881209;
        double r32881211 = -8.08619711399183e-156;
        bool r32881212 = r32881205 <= r32881211;
        double r32881213 = r32881205 * r32881208;
        double r32881214 = 4.2595672029945e-318;
        bool r32881215 = r32881205 <= r32881214;
        double r32881216 = 2.0905090728700514e+191;
        bool r32881217 = r32881205 <= r32881216;
        double r32881218 = r32881217 ? r32881213 : r32881210;
        double r32881219 = r32881215 ? r32881210 : r32881218;
        double r32881220 = r32881212 ? r32881213 : r32881219;
        double r32881221 = r32881207 ? r32881210 : r32881220;
        return r32881221;
}

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

Original14.4
Target1.4
Herbie0.5
\[\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 2 regimes
  2. if (/ y z) < -9.916325328902394e+225 or -8.08619711399183e-156 < (/ y z) < 4.2595672029945e-318 or 2.0905090728700514e+191 < (/ y z)

    1. Initial program 25.9

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

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

    if -9.916325328902394e+225 < (/ y z) < -8.08619711399183e-156 or 4.2595672029945e-318 < (/ y z) < 2.0905090728700514e+191

    1. Initial program 8.3

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

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

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

      \[\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-frac9.8

      \[\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*7.9

      \[\leadsto \color{blue}{\left(y \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{1}\right) \cdot \frac{\sqrt[3]{x}}{z}}\]
    8. Simplified7.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/10.0

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

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

      \[\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}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -9.916325328902394 \cdot 10^{+225}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -8.08619711399183 \cdot 10^{-156}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 4.2595672029945 \cdot 10^{-318}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 2.0905090728700514 \cdot 10^{+191}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]

Reproduce

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