Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.4s
Alternatives: 15
Speedup: TODO×

Specification

?
\[x + \left(y - z\right) \cdot \left(t - x\right) \]

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Target

Original100.0%
Target96.6%
Herbie100.0%
\[x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right) \]

Alternative 1?

\[\mathsf{fma}\left(y - z, t - x, x\right) \]
Derivation
  1. Initial program 100.0%

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Step-by-step derivation
    1. +-commutative100.0%

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(t - x\right) + x} \]
    2. fma-def100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
  4. Final simplification100.0%

    \[\leadsto \mathsf{fma}\left(y - z, t - x, x\right) \]

Alternative 2?

\[\begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+182}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{+144}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+48}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-95}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-171}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{-139}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 10^{+54}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Derivation
  1. Split input into 5 regimes
  2. if z < -3.80000000000000013e182 or -1.11999999999999999e144 < z < -3.10000000000000005e48 or 1.0000000000000001e54 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 62.3%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative62.3%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg62.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg62.3%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--62.3%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity62.3%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified62.3%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in z around inf 56.9%

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

    if -3.80000000000000013e182 < z < -1.11999999999999999e144

    1. Initial program 99.8%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in y around 0 74.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(t - x\right) \cdot z\right) + x} \]
    3. Step-by-step derivation
      1. +-commutative74.2%

        \[\leadsto \color{blue}{x + -1 \cdot \left(\left(t - x\right) \cdot z\right)} \]
      2. mul-1-neg74.2%

        \[\leadsto x + \color{blue}{\left(-\left(t - x\right) \cdot z\right)} \]
      3. unsub-neg74.2%

        \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
      4. *-commutative74.2%

        \[\leadsto x - \color{blue}{z \cdot \left(t - x\right)} \]
    4. Simplified74.2%

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]
    5. Taylor expanded in x around 0 68.4%

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    6. Step-by-step derivation
      1. associate-*r*68.4%

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot z} \]
      2. mul-1-neg68.4%

        \[\leadsto \color{blue}{\left(-t\right)} \cdot z \]
    7. Simplified68.4%

      \[\leadsto \color{blue}{\left(-t\right) \cdot z} \]

    if -3.10000000000000005e48 < z < -2.4999999999999999e-95

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 68.1%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative68.1%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg68.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg68.1%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--68.1%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity68.1%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified68.1%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in y around inf 40.2%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot x\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg40.2%

        \[\leadsto \color{blue}{-y \cdot x} \]
      2. distribute-rgt-neg-in40.2%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    7. Simplified40.2%

      \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]

    if -2.4999999999999999e-95 < z < 4.5000000000000004e-171 or 1.51999999999999999e-139 < z < 1.0000000000000001e54

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 97.0%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative97.0%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def97.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg97.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in97.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative97.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified97.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in y around 0 74.8%

      \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(1 + z\right) \cdot x}\right) \]
    6. Taylor expanded in y around inf 50.2%

      \[\leadsto \color{blue}{y \cdot t} \]

    if 4.5000000000000004e-171 < z < 1.51999999999999999e-139

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 87.6%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 76.3%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification53.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+182}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{+144}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+48}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-95}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-171}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{-139}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 10^{+54}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 3?

\[\begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+49}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-95}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-182}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-145}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+52}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Derivation
  1. Split input into 4 regimes
  2. if z < -1.85000000000000009e49 or 8.49999999999999994e52 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 59.1%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative59.1%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg59.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg59.1%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--59.1%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity59.1%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified59.1%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in z around inf 53.8%

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

    if -1.85000000000000009e49 < z < -4.29999999999999997e-95

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 68.1%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative68.1%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg68.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg68.1%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--68.1%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity68.1%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified68.1%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in y around inf 40.2%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot x\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg40.2%

        \[\leadsto \color{blue}{-y \cdot x} \]
      2. distribute-rgt-neg-in40.2%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    7. Simplified40.2%

      \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]

    if -4.29999999999999997e-95 < z < 5.79999999999999974e-182 or 4.8000000000000003e-145 < z < 8.49999999999999994e52

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 97.0%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative97.0%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def97.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg97.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in97.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative97.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified97.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in y around 0 74.8%

      \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(1 + z\right) \cdot x}\right) \]
    6. Taylor expanded in y around inf 50.2%

      \[\leadsto \color{blue}{y \cdot t} \]

    if 5.79999999999999974e-182 < z < 4.8000000000000003e-145

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 87.6%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 76.3%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification51.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+49}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-95}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-182}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-145}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+52}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 4?

\[\begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := \left(y - z\right) \cdot t\\ \mathbf{if}\;y \leq -3.7 \cdot 10^{+24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-211}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-85}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+30}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if y < -3.69999999999999999e24 or 2e30 < y

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 96.8%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def98.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified98.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in y around inf 81.8%

      \[\leadsto \color{blue}{\left(t + -1 \cdot x\right) \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative81.8%

        \[\leadsto \color{blue}{y \cdot \left(t + -1 \cdot x\right)} \]
      2. mul-1-neg81.8%

        \[\leadsto y \cdot \left(t + \color{blue}{\left(-x\right)}\right) \]
      3. sub-neg81.8%

        \[\leadsto y \cdot \color{blue}{\left(t - x\right)} \]
    7. Simplified81.8%

      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]

    if -3.69999999999999999e24 < y < -6.4999999999999996e-211 or 2.60000000000000011e-85 < y < 2e30

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 98.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative98.4%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in t around inf 55.1%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]

    if -6.4999999999999996e-211 < y < 2.60000000000000011e-85

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 72.6%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative72.6%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg72.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg72.6%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--72.6%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity72.6%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified72.6%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in z around inf 44.5%

      \[\leadsto \color{blue}{z \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+24}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-211}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-85}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+30}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 5?

\[\begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ t_2 := y \cdot \left(t - x\right)\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-185}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-81}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+30}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7e21 or 8.4999999999999995e30 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 98.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative98.4%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in z around inf 84.2%

      \[\leadsto \color{blue}{\left(-1 \cdot t + x\right) \cdot z} \]
    6. Step-by-step derivation
      1. +-commutative84.2%

        \[\leadsto \color{blue}{\left(x + -1 \cdot t\right)} \cdot z \]
      2. mul-1-neg84.2%

        \[\leadsto \left(x + \color{blue}{\left(-t\right)}\right) \cdot z \]
      3. sub-neg84.2%

        \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
      4. *-commutative84.2%

        \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]
    7. Simplified84.2%

      \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]

    if -1.7e21 < z < 3.7e-185 or 2.7999999999999999e-81 < z < 8.4999999999999995e30

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 96.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative96.4%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def98.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg98.2%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in98.2%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative98.2%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified98.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in y around inf 73.3%

      \[\leadsto \color{blue}{\left(t + -1 \cdot x\right) \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative73.3%

        \[\leadsto \color{blue}{y \cdot \left(t + -1 \cdot x\right)} \]
      2. mul-1-neg73.3%

        \[\leadsto y \cdot \left(t + \color{blue}{\left(-x\right)}\right) \]
      3. sub-neg73.3%

        \[\leadsto y \cdot \color{blue}{\left(t - x\right)} \]
    7. Simplified73.3%

      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]

    if 3.7e-185 < z < 2.7999999999999999e-81

    1. Initial program 99.8%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 87.7%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in z around 0 82.0%

      \[\leadsto \color{blue}{y \cdot t + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+21}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-185}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-81}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+30}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 6?

\[\begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+33}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-178}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-137}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+50}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if z < -1.8000000000000001e33 or 3.10000000000000003e50 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 58.7%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative58.7%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg58.7%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg58.7%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--58.7%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity58.7%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified58.7%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in z around inf 52.8%

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

    if -1.8000000000000001e33 < z < 3.80000000000000015e-178 or 3.79999999999999999e-137 < z < 3.10000000000000003e50

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 96.8%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def98.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified98.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in y around 0 72.3%

      \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(1 + z\right) \cdot x}\right) \]
    6. Taylor expanded in y around inf 44.8%

      \[\leadsto \color{blue}{y \cdot t} \]

    if 3.80000000000000015e-178 < z < 3.79999999999999999e-137

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 87.6%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 76.3%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+33}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-178}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-137}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+50}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 7?

\[\begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-13} \lor \neg \left(x \leq 6.1 \cdot 10^{-46}\right):\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if x < -4.0000000000000001e-13 or 6.10000000000000035e-46 < x

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 82.0%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative82.0%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg82.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg82.0%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--82.0%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity82.0%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified82.0%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in x around 0 82.0%

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

    if -4.0000000000000001e-13 < x < 6.10000000000000035e-46

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 99.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in t around inf 76.4%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-13} \lor \neg \left(x \leq 6.1 \cdot 10^{-46}\right):\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]

Alternative 8?

\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-6} \lor \neg \left(x \leq 6.5 \cdot 10^{-45}\right):\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if x < -6.4999999999999996e-6 or 6.4999999999999995e-45 < x

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 82.0%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative82.0%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg82.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg82.0%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--82.0%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity82.0%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified82.0%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in x around 0 82.0%

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

    if -6.4999999999999996e-6 < x < 6.4999999999999995e-45

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 81.6%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-6} \lor \neg \left(x \leq 6.5 \cdot 10^{-45}\right):\\ \;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array} \]

Alternative 9?

\[\begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+21} \lor \neg \left(z \leq 7.5 \cdot 10^{+30}\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if z < -3.7e21 or 7.49999999999999973e30 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 98.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative98.4%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in z around inf 84.2%

      \[\leadsto \color{blue}{\left(-1 \cdot t + x\right) \cdot z} \]
    6. Step-by-step derivation
      1. +-commutative84.2%

        \[\leadsto \color{blue}{\left(x + -1 \cdot t\right)} \cdot z \]
      2. mul-1-neg84.2%

        \[\leadsto \left(x + \color{blue}{\left(-t\right)}\right) \cdot z \]
      3. sub-neg84.2%

        \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
      4. *-commutative84.2%

        \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]
    7. Simplified84.2%

      \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]

    if -3.7e21 < z < 7.49999999999999973e30

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in z around 0 92.4%

      \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+21} \lor \neg \left(z \leq 7.5 \cdot 10^{+30}\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 10?

\[\begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -1.62 \cdot 10^{+14}:\\ \;\;\;\;x + t_1\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{+32}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if z < -1.62e14

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in y around 0 83.2%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(t - x\right) \cdot z\right) + x} \]
    3. Step-by-step derivation
      1. +-commutative83.2%

        \[\leadsto \color{blue}{x + -1 \cdot \left(\left(t - x\right) \cdot z\right)} \]
      2. mul-1-neg83.2%

        \[\leadsto x + \color{blue}{\left(-\left(t - x\right) \cdot z\right)} \]
      3. unsub-neg83.2%

        \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
      4. *-commutative83.2%

        \[\leadsto x - \color{blue}{z \cdot \left(t - x\right)} \]
    4. Simplified83.2%

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]

    if -1.62e14 < z < 1.28e32

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in z around 0 93.0%

      \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]

    if 1.28e32 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 97.0%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative97.0%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in z around inf 84.2%

      \[\leadsto \color{blue}{\left(-1 \cdot t + x\right) \cdot z} \]
    6. Step-by-step derivation
      1. +-commutative84.2%

        \[\leadsto \color{blue}{\left(x + -1 \cdot t\right)} \cdot z \]
      2. mul-1-neg84.2%

        \[\leadsto \left(x + \color{blue}{\left(-t\right)}\right) \cdot z \]
      3. sub-neg84.2%

        \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
      4. *-commutative84.2%

        \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]
    7. Simplified84.2%

      \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.62 \cdot 10^{+14}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{+32}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 11?

\[\begin{array}{l} \mathbf{if}\;t \leq -6.6 \cdot 10^{-117} \lor \neg \left(t \leq 1.28 \cdot 10^{-54}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if t < -6.6000000000000003e-117 or 1.2800000000000001e-54 < t

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 96.3%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative96.3%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg98.7%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in98.7%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative98.7%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified98.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in t around inf 67.5%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]

    if -6.6000000000000003e-117 < t < 1.2800000000000001e-54

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around inf 86.6%

      \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y - z\right)\right) \cdot x} \]
    3. Step-by-step derivation
      1. *-commutative86.6%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
      2. mul-1-neg86.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      3. unsub-neg86.6%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--86.6%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \left(y - z\right)} \]
      5. *-rgt-identity86.6%

        \[\leadsto \color{blue}{x} - x \cdot \left(y - z\right) \]
    4. Simplified86.6%

      \[\leadsto \color{blue}{x - x \cdot \left(y - z\right)} \]
    5. Taylor expanded in z around inf 40.0%

      \[\leadsto \color{blue}{z \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.6 \cdot 10^{-117} \lor \neg \left(t \leq 1.28 \cdot 10^{-54}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 12?

\[\begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+21} \lor \neg \left(z \leq 1.85 \cdot 10^{+31}\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5e21 or 1.8499999999999999e31 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 98.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative98.4%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in z around inf 84.2%

      \[\leadsto \color{blue}{\left(-1 \cdot t + x\right) \cdot z} \]
    6. Step-by-step derivation
      1. +-commutative84.2%

        \[\leadsto \color{blue}{\left(x + -1 \cdot t\right)} \cdot z \]
      2. mul-1-neg84.2%

        \[\leadsto \left(x + \color{blue}{\left(-t\right)}\right) \cdot z \]
      3. sub-neg84.2%

        \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
      4. *-commutative84.2%

        \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]
    7. Simplified84.2%

      \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]

    if -4.5e21 < z < 1.8499999999999999e31

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 96.8%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def98.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative98.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified98.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in y around inf 70.4%

      \[\leadsto \color{blue}{\left(t + -1 \cdot x\right) \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative70.4%

        \[\leadsto \color{blue}{y \cdot \left(t + -1 \cdot x\right)} \]
      2. mul-1-neg70.4%

        \[\leadsto y \cdot \left(t + \color{blue}{\left(-x\right)}\right) \]
      3. sub-neg70.4%

        \[\leadsto y \cdot \color{blue}{\left(t - x\right)} \]
    7. Simplified70.4%

      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+21} \lor \neg \left(z \leq 1.85 \cdot 10^{+31}\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 13?

\[x + \left(y - z\right) \cdot \left(t - x\right) \]
Derivation
  1. Initial program 100.0%

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Final simplification100.0%

    \[\leadsto x + \left(y - z\right) \cdot \left(t - x\right) \]

Alternative 14?

\[\begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-62}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-84}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5999999999999999e-62 or 8.4999999999999994e-84 < y

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in x around -inf 96.9%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right) + t \cdot \left(y - z\right)} \]
    3. Step-by-step derivation
      1. +-commutative96.9%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right) + -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)} \]
      2. fma-def98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, -1 \cdot \left(\left(y - \left(1 + z\right)\right) \cdot x\right)\right)} \]
      3. mul-1-neg98.7%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-\left(y - \left(1 + z\right)\right) \cdot x}\right) \]
      4. distribute-rgt-neg-in98.7%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(y - \left(1 + z\right)\right) \cdot \left(-x\right)}\right) \]
      5. +-commutative98.7%

        \[\leadsto \mathsf{fma}\left(t, y - z, \left(y - \color{blue}{\left(z + 1\right)}\right) \cdot \left(-x\right)\right) \]
    4. Simplified98.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, \left(y - \left(z + 1\right)\right) \cdot \left(-x\right)\right)} \]
    5. Taylor expanded in y around 0 73.1%

      \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{\left(1 + z\right) \cdot x}\right) \]
    6. Taylor expanded in y around inf 43.3%

      \[\leadsto \color{blue}{y \cdot t} \]

    if -2.5999999999999999e-62 < y < 8.4999999999999994e-84

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Taylor expanded in t around inf 63.1%

      \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
    3. Taylor expanded in x around inf 29.8%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification38.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-62}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-84}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 15?

\[x \]
Derivation
  1. Initial program 100.0%

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Taylor expanded in t around inf 60.0%

    \[\leadsto x + \color{blue}{t \cdot \left(y - z\right)} \]
  3. Taylor expanded in x around inf 13.8%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification13.8%

    \[\leadsto x \]

Reproduce

?
herbie shell --seed 2023166 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
  :precision binary64

  :herbie-target
  (+ x (+ (* t (- y z)) (* (- x) (- y z))))

  (+ x (* (- y z) (- t x))))