Average Error: 14.5 → 2.1
Time: 4.2s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.2418990532793928 \cdot 10^{+215}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.0586797070343968 \cdot 10^{-121}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le -0.0:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \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 2 regimes
  2. if (/ y z) < -1.2418990532793928e+215 or -3.0586797070343968e-121 < (/ y z) < -0.0

    1. Initial program 21.1

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

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

    if -1.2418990532793928e+215 < (/ y z) < -3.0586797070343968e-121 or -0.0 < (/ y z)

    1. Initial program 11.5

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/8.1

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

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

      \[\leadsto \left(y \cdot x\right) \cdot \color{blue}{{\left(\frac{1}{z}\right)}^{1}}\]
    9. Applied pow18.2

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

      \[\leadsto \color{blue}{{\left(\left(y \cdot x\right) \cdot \frac{1}{z}\right)}^{1}}\]
    11. Simplified2.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.2418990532793928 \cdot 10^{+215}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.0586797070343968 \cdot 10^{-121}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le -0.0:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

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