Average Error: 14.1 → 1.3
Time: 18.9s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.3903853374461529 \cdot 10^{+308}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.04698342098442 \cdot 10^{-113}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 6.127522930284051 \cdot 10^{-231}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.343276368988314 \cdot 10^{+58}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if (/ y z) < -1.3903853374461529e+308 or -3.04698342098442e-113 < (/ y z) < 6.127522930284051e-231 or 1.343276368988314e+58 < (/ y z)

    1. Initial program 20.7

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

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

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

    if -1.3903853374461529e+308 < (/ y z) < -3.04698342098442e-113

    1. Initial program 8.7

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

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

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

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

    if 6.127522930284051e-231 < (/ y z) < 1.343276368988314e+58

    1. Initial program 6.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.3903853374461529 \cdot 10^{+308}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -3.04698342098442 \cdot 10^{-113}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 6.127522930284051 \cdot 10^{-231}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.343276368988314 \cdot 10^{+58}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

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