Average Error: 14.6 → 1.2
Time: 4.0s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \le -1.973500074959674 \cdot 10^{+305}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \le -8.749107860908653 \cdot 10^{-301}:\\ \;\;\;\;x \cdot \left(\frac{1}{z} \cdot y\right)\\ \mathbf{elif}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \le 2.8145871383455178 \cdot 10^{-307}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \le 1.7170173022787078 \cdot 10^{+307}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array}\]

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

Derivation

  1. Split input into 4 regimes
  2. if (* x (/ (* (/ y z) t) t)) < -1.973500074959674e+305 or -8.749107860908653e-301 < (* x (/ (* (/ y z) t) t)) < 2.8145871383455178e-307

    1. Initial program 28.4

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

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

    if -1.973500074959674e+305 < (* x (/ (* (/ y z) t) t)) < -8.749107860908653e-301

    1. Initial program 0.9

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around -inf 9.5

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

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
    6. Using strategy rm
    7. Applied associate-*l*0.6

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{1}{z}\right)}\]

    if 2.8145871383455178e-307 < (* x (/ (* (/ y z) t) t)) < 1.7170173022787078e+307

    1. Initial program 0.9

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around -inf 9.3

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied associate-/l*0.5

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

    if 1.7170173022787078e+307 < (* x (/ (* (/ y z) t) t))

    1. Initial program 60.7

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around -inf 4.5

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

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
    6. Using strategy rm
    7. Applied pow14.6

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{{\left(\frac{1}{z}\right)}^{1}}\]
    8. Applied pow14.6

      \[\leadsto \color{blue}{{\left(x \cdot y\right)}^{1}} \cdot {\left(\frac{1}{z}\right)}^{1}\]
    9. Applied pow-prod-down4.6

      \[\leadsto \color{blue}{{\left(\left(x \cdot y\right) \cdot \frac{1}{z}\right)}^{1}}\]
    10. Simplified3.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \le -1.973500074959674 \cdot 10^{+305}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \le -8.749107860908653 \cdot 10^{-301}:\\ \;\;\;\;x \cdot \left(\frac{1}{z} \cdot y\right)\\ \mathbf{elif}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \le 2.8145871383455178 \cdot 10^{-307}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;x \cdot \frac{\frac{y}{z} \cdot t}{t} \le 1.7170173022787078 \cdot 10^{+307}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array}\]

Reproduce

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