System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2

Percentage Accurate: 61.2% → 96.0%
Time: 18.7s
Alternatives: 15
Speedup: 11.3×

Specification

?
\[\begin{array}{l} \\ x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
	return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t):
	return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t))
end
function tmp = code(x, y, z, t)
	tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t);
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\end{array}

Sampling outcomes in binary64 precision:

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.

Initial Program: 61.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
	return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t):
	return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t))
end
function tmp = code(x, y, z, t)
	tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t);
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\end{array}

Alternative 1: 96.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{expm1}\left(z\right) \cdot y\\ t_2 := e^{z} \cdot y + \left(1 - y\right)\\ \mathbf{if}\;t\_2 \leq 0:\\ \;\;\;\;\frac{t \cdot x - \mathsf{log1p}\left(t\_1\right)}{t}\\ \mathbf{elif}\;t\_2 \leq 1.000005:\\ \;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log t\_1}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (expm1 z) y)) (t_2 (+ (* (exp z) y) (- 1.0 y))))
   (if (<= t_2 0.0)
     (/ (- (* t x) (log1p t_1)) t)
     (if (<= t_2 1.000005)
       (- x (/ 1.0 (fma 0.5 t (/ (/ t (expm1 z)) y))))
       (- x (/ (log t_1) t))))))
double code(double x, double y, double z, double t) {
	double t_1 = expm1(z) * y;
	double t_2 = (exp(z) * y) + (1.0 - y);
	double tmp;
	if (t_2 <= 0.0) {
		tmp = ((t * x) - log1p(t_1)) / t;
	} else if (t_2 <= 1.000005) {
		tmp = x - (1.0 / fma(0.5, t, ((t / expm1(z)) / y)));
	} else {
		tmp = x - (log(t_1) / t);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(expm1(z) * y)
	t_2 = Float64(Float64(exp(z) * y) + Float64(1.0 - y))
	tmp = 0.0
	if (t_2 <= 0.0)
		tmp = Float64(Float64(Float64(t * x) - log1p(t_1)) / t);
	elseif (t_2 <= 1.000005)
		tmp = Float64(x - Float64(1.0 / fma(0.5, t, Float64(Float64(t / expm1(z)) / y))));
	else
		tmp = Float64(x - Float64(log(t_1) / t));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(Exp[z] - 1), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Exp[z], $MachinePrecision] * y), $MachinePrecision] + N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(N[(N[(t * x), $MachinePrecision] - N[Log[1 + t$95$1], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$2, 1.000005], N[(x - N[(1.0 / N[(0.5 * t + N[(N[(t / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[t$95$1], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{expm1}\left(z\right) \cdot y\\
t_2 := e^{z} \cdot y + \left(1 - y\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\frac{t \cdot x - \mathsf{log1p}\left(t\_1\right)}{t}\\

\mathbf{elif}\;t\_2 \leq 1.000005:\\
\;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\log t\_1}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 0.0

    1. Initial program 2.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{t}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t} + x} \]
      2. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot z}{t}\right)\right)} + x \]
      3. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{z \cdot y}}{t}\right)\right) + x \]
      4. associate-*r/N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{z \cdot \frac{y}{t}}\right)\right) + x \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \frac{y}{t}} + x \]
      6. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot z\right)} \cdot \frac{y}{t} + x \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot z, \frac{y}{t}, x\right)} \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, \frac{y}{t}, x\right) \]
      9. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, \frac{y}{t}, x\right) \]
      10. lower-/.f6472.2

        \[\leadsto \mathsf{fma}\left(-z, \color{blue}{\frac{y}{t}}, x\right) \]
    5. Applied rewrites72.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-z, \frac{y}{t}, x\right)} \]
    6. Taylor expanded in t around 0

      \[\leadsto -1 \cdot \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. Applied rewrites18.0%

        \[\leadsto \frac{-z}{t} \cdot \color{blue}{y} \]
      2. Taylor expanded in t around 0

        \[\leadsto \color{blue}{\frac{t \cdot x - \log \left(\left(1 + y \cdot e^{z}\right) - y\right)}{t}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{t \cdot x - \log \left(\left(1 + y \cdot e^{z}\right) - y\right)}{t}} \]
        2. lower--.f64N/A

          \[\leadsto \frac{\color{blue}{t \cdot x - \log \left(\left(1 + y \cdot e^{z}\right) - y\right)}}{t} \]
        3. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{x \cdot t} - \log \left(\left(1 + y \cdot e^{z}\right) - y\right)}{t} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot t} - \log \left(\left(1 + y \cdot e^{z}\right) - y\right)}{t} \]
        5. associate--l+N/A

          \[\leadsto \frac{x \cdot t - \log \color{blue}{\left(1 + \left(y \cdot e^{z} - y\right)\right)}}{t} \]
        6. sub-negN/A

          \[\leadsto \frac{x \cdot t - \log \left(1 + \color{blue}{\left(y \cdot e^{z} + \left(\mathsf{neg}\left(y\right)\right)\right)}\right)}{t} \]
        7. mul-1-negN/A

          \[\leadsto \frac{x \cdot t - \log \left(1 + \left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)\right)}{t} \]
        8. *-commutativeN/A

          \[\leadsto \frac{x \cdot t - \log \left(1 + \left(y \cdot e^{z} + \color{blue}{y \cdot -1}\right)\right)}{t} \]
        9. distribute-lft-inN/A

          \[\leadsto \frac{x \cdot t - \log \left(1 + \color{blue}{y \cdot \left(e^{z} + -1\right)}\right)}{t} \]
        10. metadata-evalN/A

          \[\leadsto \frac{x \cdot t - \log \left(1 + y \cdot \left(e^{z} + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)}{t} \]
        11. sub-negN/A

          \[\leadsto \frac{x \cdot t - \log \left(1 + y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
        12. lower-log1p.f64N/A

          \[\leadsto \frac{x \cdot t - \color{blue}{\mathsf{log1p}\left(y \cdot \left(e^{z} - 1\right)\right)}}{t} \]
        13. *-commutativeN/A

          \[\leadsto \frac{x \cdot t - \mathsf{log1p}\left(\color{blue}{\left(e^{z} - 1\right) \cdot y}\right)}{t} \]
        14. lower-*.f64N/A

          \[\leadsto \frac{x \cdot t - \mathsf{log1p}\left(\color{blue}{\left(e^{z} - 1\right) \cdot y}\right)}{t} \]
        15. lower-expm1.f6494.3

          \[\leadsto \frac{x \cdot t - \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y\right)}{t} \]
      4. Applied rewrites94.3%

        \[\leadsto \color{blue}{\frac{x \cdot t - \mathsf{log1p}\left(\mathsf{expm1}\left(z\right) \cdot y\right)}{t}} \]

      if 0.0 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 1.00000500000000003

      1. Initial program 75.1%

        \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
        2. lower-*.f64N/A

          \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
        3. lower-expm1.f6495.9

          \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
      5. Applied rewrites95.9%

        \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
      6. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
        2. clear-numN/A

          \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
        3. lower-/.f64N/A

          \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
        4. lower-/.f6495.8

          \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
      7. Applied rewrites95.8%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
      8. Taylor expanded in y around 0

        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
      9. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
        2. *-commutativeN/A

          \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
        3. lower-fma.f64N/A

          \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
        4. lower-*.f64N/A

          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
        5. lower-/.f64N/A

          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
        6. lower-expm1.f6499.9

          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
      10. Applied rewrites99.9%

        \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
      11. Taylor expanded in y around inf

        \[\leadsto x - \frac{1}{\frac{1}{2} \cdot t + \color{blue}{\frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
      12. Step-by-step derivation
        1. Applied rewrites99.9%

          \[\leadsto x - \frac{1}{\mathsf{fma}\left(0.5, \color{blue}{t}, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)} \]

        if 1.00000500000000003 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z)))

        1. Initial program 93.8%

          \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto x - \frac{\log \color{blue}{\left(y \cdot \left(e^{z} - 1\right)\right)}}{t} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x - \frac{\log \color{blue}{\left(\left(e^{z} - 1\right) \cdot y\right)}}{t} \]
          2. lower-*.f64N/A

            \[\leadsto x - \frac{\log \color{blue}{\left(\left(e^{z} - 1\right) \cdot y\right)}}{t} \]
          3. lower-expm1.f6496.9

            \[\leadsto x - \frac{\log \left(\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y\right)}{t} \]
        5. Applied rewrites96.9%

          \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{expm1}\left(z\right) \cdot y\right)}}{t} \]
      13. Recombined 3 regimes into one program.
      14. Final simplification98.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \cdot y + \left(1 - y\right) \leq 0:\\ \;\;\;\;\frac{t \cdot x - \mathsf{log1p}\left(\mathsf{expm1}\left(z\right) \cdot y\right)}{t}\\ \mathbf{elif}\;e^{z} \cdot y + \left(1 - y\right) \leq 1.000005:\\ \;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{expm1}\left(z\right) \cdot y\right)}{t}\\ \end{array} \]
      15. Add Preprocessing

      Alternative 2: 94.6% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \cdot y + \left(1 - y\right) \leq 1.000005:\\ \;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{expm1}\left(z\right) \cdot y\right)}{t}\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= (+ (* (exp z) y) (- 1.0 y)) 1.000005)
         (- x (/ 1.0 (fma 0.5 t (/ (/ t (expm1 z)) y))))
         (- x (/ (log (* (expm1 z) y)) t))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (((exp(z) * y) + (1.0 - y)) <= 1.000005) {
      		tmp = x - (1.0 / fma(0.5, t, ((t / expm1(z)) / y)));
      	} else {
      		tmp = x - (log((expm1(z) * y)) / t);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (Float64(Float64(exp(z) * y) + Float64(1.0 - y)) <= 1.000005)
      		tmp = Float64(x - Float64(1.0 / fma(0.5, t, Float64(Float64(t / expm1(z)) / y))));
      	else
      		tmp = Float64(x - Float64(log(Float64(expm1(z) * y)) / t));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[Exp[z], $MachinePrecision] * y), $MachinePrecision] + N[(1.0 - y), $MachinePrecision]), $MachinePrecision], 1.000005], N[(x - N[(1.0 / N[(0.5 * t + N[(N[(t / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(N[(Exp[z] - 1), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;e^{z} \cdot y + \left(1 - y\right) \leq 1.000005:\\
      \;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;x - \frac{\log \left(\mathsf{expm1}\left(z\right) \cdot y\right)}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 1.00000500000000003

        1. Initial program 52.5%

          \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
          2. lower-*.f64N/A

            \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
          3. lower-expm1.f6489.9

            \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
        5. Applied rewrites89.9%

          \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
        6. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
          2. clear-numN/A

            \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
          3. lower-/.f64N/A

            \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
          4. lower-/.f6489.8

            \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
        7. Applied rewrites89.8%

          \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
        8. Taylor expanded in y around 0

          \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
        9. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
          2. *-commutativeN/A

            \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
          3. lower-fma.f64N/A

            \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
          4. lower-*.f64N/A

            \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
          5. lower-/.f64N/A

            \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
          6. lower-expm1.f6493.5

            \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
        10. Applied rewrites93.5%

          \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
        11. Taylor expanded in y around inf

          \[\leadsto x - \frac{1}{\frac{1}{2} \cdot t + \color{blue}{\frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
        12. Step-by-step derivation
          1. Applied rewrites94.4%

            \[\leadsto x - \frac{1}{\mathsf{fma}\left(0.5, \color{blue}{t}, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)} \]

          if 1.00000500000000003 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z)))

          1. Initial program 93.8%

            \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
          2. Add Preprocessing
          3. Taylor expanded in y around inf

            \[\leadsto x - \frac{\log \color{blue}{\left(y \cdot \left(e^{z} - 1\right)\right)}}{t} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto x - \frac{\log \color{blue}{\left(\left(e^{z} - 1\right) \cdot y\right)}}{t} \]
            2. lower-*.f64N/A

              \[\leadsto x - \frac{\log \color{blue}{\left(\left(e^{z} - 1\right) \cdot y\right)}}{t} \]
            3. lower-expm1.f6496.9

              \[\leadsto x - \frac{\log \left(\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y\right)}{t} \]
          5. Applied rewrites96.9%

            \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{expm1}\left(z\right) \cdot y\right)}}{t} \]
        13. Recombined 2 regimes into one program.
        14. Final simplification94.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \cdot y + \left(1 - y\right) \leq 1.000005:\\ \;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{expm1}\left(z\right) \cdot y\right)}{t}\\ \end{array} \]
        15. Add Preprocessing

        Alternative 3: 90.4% accurate, 1.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z, 0.5\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= y -5.4e+18)
           (- x (/ 1.0 (/ (/ (fma (* 0.5 z) (- (* t y) t) t) z) y)))
           (if (<= y 4.5e+87)
             (- x (* (/ (expm1 z) t) y))
             (-
              x
              (/
               (log (fma (fma (* (fma 0.16666666666666666 z 0.5) y) z y) z 1.0))
               t)))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (y <= -5.4e+18) {
        		tmp = x - (1.0 / ((fma((0.5 * z), ((t * y) - t), t) / z) / y));
        	} else if (y <= 4.5e+87) {
        		tmp = x - ((expm1(z) / t) * y);
        	} else {
        		tmp = x - (log(fma(fma((fma(0.16666666666666666, z, 0.5) * y), z, y), z, 1.0)) / t);
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (y <= -5.4e+18)
        		tmp = Float64(x - Float64(1.0 / Float64(Float64(fma(Float64(0.5 * z), Float64(Float64(t * y) - t), t) / z) / y)));
        	elseif (y <= 4.5e+87)
        		tmp = Float64(x - Float64(Float64(expm1(z) / t) * y));
        	else
        		tmp = Float64(x - Float64(log(fma(fma(Float64(fma(0.16666666666666666, z, 0.5) * y), z, y), z, 1.0)) / t));
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[y, -5.4e+18], N[(x - N[(1.0 / N[(N[(N[(N[(0.5 * z), $MachinePrecision] * N[(N[(t * y), $MachinePrecision] - t), $MachinePrecision] + t), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+87], N[(x - N[(N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(N[(N[(N[(0.16666666666666666 * z + 0.5), $MachinePrecision] * y), $MachinePrecision] * z + y), $MachinePrecision] * z + 1.0), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\
        \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\
        
        \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\
        \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z, 0.5\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -5.4e18

          1. Initial program 39.7%

            \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
          2. Add Preprocessing
          3. Taylor expanded in y around 0

            \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
            2. lower-*.f64N/A

              \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
            3. lower-expm1.f6461.7

              \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
          5. Applied rewrites61.7%

            \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
          6. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
            2. clear-numN/A

              \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
            3. lower-/.f64N/A

              \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
            4. lower-/.f6461.7

              \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
          7. Applied rewrites61.7%

            \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
          8. Taylor expanded in y around 0

            \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
          9. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
            2. *-commutativeN/A

              \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
            3. lower-fma.f64N/A

              \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
            4. lower-*.f64N/A

              \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
            5. lower-/.f64N/A

              \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
            6. lower-expm1.f6473.8

              \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
          10. Applied rewrites73.8%

            \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
          11. Taylor expanded in z around 0

            \[\leadsto x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}} \]
          12. Step-by-step derivation
            1. Applied rewrites76.1%

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

            if -5.4e18 < y < 4.5000000000000003e87

            1. Initial program 71.0%

              \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
            2. Add Preprocessing
            3. Taylor expanded in y around 0

              \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
            4. Step-by-step derivation
              1. associate-/l*N/A

                \[\leadsto x - \color{blue}{y \cdot \frac{e^{z} - 1}{t}} \]
              2. div-subN/A

                \[\leadsto x - y \cdot \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right)} \]
              3. *-commutativeN/A

                \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
              4. lower-*.f64N/A

                \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
              5. div-subN/A

                \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
              6. lower-/.f64N/A

                \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
              7. lower-expm1.f6498.9

                \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t} \cdot y \]
            5. Applied rewrites98.9%

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

            if 4.5000000000000003e87 < y

            1. Initial program 13.4%

              \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
            2. Add Preprocessing
            3. Taylor expanded in z around 0

              \[\leadsto x - \frac{\log \color{blue}{\left(1 + z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right)\right)}}{t} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto x - \frac{\log \color{blue}{\left(z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right) + 1\right)}}{t} \]
              2. *-commutativeN/A

                \[\leadsto x - \frac{\log \left(\color{blue}{\left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right) \cdot z} + 1\right)}{t} \]
              3. lower-fma.f64N/A

                \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right), z, 1\right)\right)}}{t} \]
              4. +-commutativeN/A

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right) + y}, z, 1\right)\right)}{t} \]
              5. *-commutativeN/A

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right) \cdot z} + y, z, 1\right)\right)}{t} \]
              6. lower-fma.f64N/A

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y, z, y\right)}, z, 1\right)\right)}{t} \]
              7. *-commutativeN/A

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6} \cdot \color{blue}{\left(z \cdot y\right)} + \frac{1}{2} \cdot y, z, y\right), z, 1\right)\right)}{t} \]
              8. associate-*r*N/A

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{6} \cdot z\right) \cdot y} + \frac{1}{2} \cdot y, z, y\right), z, 1\right)\right)}{t} \]
              9. distribute-rgt-outN/A

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{y \cdot \left(\frac{1}{6} \cdot z + \frac{1}{2}\right)}, z, y\right), z, 1\right)\right)}{t} \]
              10. lower-*.f64N/A

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{y \cdot \left(\frac{1}{6} \cdot z + \frac{1}{2}\right)}, z, y\right), z, 1\right)\right)}{t} \]
              11. lower-fma.f6491.0

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot \color{blue}{\mathsf{fma}\left(0.16666666666666666, z, 0.5\right)}, z, y\right), z, 1\right)\right)}{t} \]
            5. Applied rewrites91.0%

              \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot \mathsf{fma}\left(0.16666666666666666, z, 0.5\right), z, y\right), z, 1\right)\right)}}{t} \]
          13. Recombined 3 regimes into one program.
          14. Final simplification92.1%

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z, 0.5\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\ \end{array} \]
          15. Add Preprocessing

          Alternative 4: 90.3% accurate, 1.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\left(0.16666666666666666 \cdot z\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= y -5.4e+18)
             (- x (/ 1.0 (/ (/ (fma (* 0.5 z) (- (* t y) t) t) z) y)))
             (if (<= y 4.5e+87)
               (- x (* (/ (expm1 z) t) y))
               (- x (/ (log (fma (fma (* (* 0.16666666666666666 z) y) z y) z 1.0)) t)))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (y <= -5.4e+18) {
          		tmp = x - (1.0 / ((fma((0.5 * z), ((t * y) - t), t) / z) / y));
          	} else if (y <= 4.5e+87) {
          		tmp = x - ((expm1(z) / t) * y);
          	} else {
          		tmp = x - (log(fma(fma(((0.16666666666666666 * z) * y), z, y), z, 1.0)) / t);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (y <= -5.4e+18)
          		tmp = Float64(x - Float64(1.0 / Float64(Float64(fma(Float64(0.5 * z), Float64(Float64(t * y) - t), t) / z) / y)));
          	elseif (y <= 4.5e+87)
          		tmp = Float64(x - Float64(Float64(expm1(z) / t) * y));
          	else
          		tmp = Float64(x - Float64(log(fma(fma(Float64(Float64(0.16666666666666666 * z) * y), z, y), z, 1.0)) / t));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[y, -5.4e+18], N[(x - N[(1.0 / N[(N[(N[(N[(0.5 * z), $MachinePrecision] * N[(N[(t * y), $MachinePrecision] - t), $MachinePrecision] + t), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+87], N[(x - N[(N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(N[(N[(N[(0.16666666666666666 * z), $MachinePrecision] * y), $MachinePrecision] * z + y), $MachinePrecision] * z + 1.0), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\
          \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\
          
          \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\
          \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\left(0.16666666666666666 \cdot z\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -5.4e18

            1. Initial program 39.7%

              \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
            2. Add Preprocessing
            3. Taylor expanded in y around 0

              \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
              2. lower-*.f64N/A

                \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
              3. lower-expm1.f6461.7

                \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
            5. Applied rewrites61.7%

              \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
            6. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
              2. clear-numN/A

                \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
              3. lower-/.f64N/A

                \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
              4. lower-/.f6461.7

                \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
            7. Applied rewrites61.7%

              \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
            8. Taylor expanded in y around 0

              \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
            9. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
              2. *-commutativeN/A

                \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
              3. lower-fma.f64N/A

                \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
              4. lower-*.f64N/A

                \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
              5. lower-/.f64N/A

                \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
              6. lower-expm1.f6473.8

                \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
            10. Applied rewrites73.8%

              \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
            11. Taylor expanded in z around 0

              \[\leadsto x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}} \]
            12. Step-by-step derivation
              1. Applied rewrites76.1%

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

              if -5.4e18 < y < 4.5000000000000003e87

              1. Initial program 71.0%

                \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
              2. Add Preprocessing
              3. Taylor expanded in y around 0

                \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
              4. Step-by-step derivation
                1. associate-/l*N/A

                  \[\leadsto x - \color{blue}{y \cdot \frac{e^{z} - 1}{t}} \]
                2. div-subN/A

                  \[\leadsto x - y \cdot \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right)} \]
                3. *-commutativeN/A

                  \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                4. lower-*.f64N/A

                  \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                5. div-subN/A

                  \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                6. lower-/.f64N/A

                  \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                7. lower-expm1.f6498.9

                  \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t} \cdot y \]
              5. Applied rewrites98.9%

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

              if 4.5000000000000003e87 < y

              1. Initial program 13.4%

                \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
              2. Add Preprocessing
              3. Taylor expanded in z around 0

                \[\leadsto x - \frac{\log \color{blue}{\left(1 + z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right)\right)}}{t} \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto x - \frac{\log \color{blue}{\left(z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right) + 1\right)}}{t} \]
                2. *-commutativeN/A

                  \[\leadsto x - \frac{\log \left(\color{blue}{\left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right) \cdot z} + 1\right)}{t} \]
                3. lower-fma.f64N/A

                  \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right), z, 1\right)\right)}}{t} \]
                4. +-commutativeN/A

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right) + y}, z, 1\right)\right)}{t} \]
                5. *-commutativeN/A

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right) \cdot z} + y, z, 1\right)\right)}{t} \]
                6. lower-fma.f64N/A

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y, z, y\right)}, z, 1\right)\right)}{t} \]
                7. *-commutativeN/A

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6} \cdot \color{blue}{\left(z \cdot y\right)} + \frac{1}{2} \cdot y, z, y\right), z, 1\right)\right)}{t} \]
                8. associate-*r*N/A

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{6} \cdot z\right) \cdot y} + \frac{1}{2} \cdot y, z, y\right), z, 1\right)\right)}{t} \]
                9. distribute-rgt-outN/A

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{y \cdot \left(\frac{1}{6} \cdot z + \frac{1}{2}\right)}, z, y\right), z, 1\right)\right)}{t} \]
                10. lower-*.f64N/A

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{y \cdot \left(\frac{1}{6} \cdot z + \frac{1}{2}\right)}, z, y\right), z, 1\right)\right)}{t} \]
                11. lower-fma.f6491.0

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot \color{blue}{\mathsf{fma}\left(0.16666666666666666, z, 0.5\right)}, z, y\right), z, 1\right)\right)}{t} \]
              5. Applied rewrites91.0%

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

                \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot \left(\frac{1}{6} \cdot z\right), z, y\right), z, 1\right)\right)}{t} \]
              7. Step-by-step derivation
                1. Applied rewrites91.0%

                  \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot z\right), z, y\right), z, 1\right)\right)}{t} \]
              8. Recombined 3 regimes into one program.
              9. Final simplification92.1%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\left(0.16666666666666666 \cdot z\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\ \end{array} \]
              10. Add Preprocessing

              Alternative 5: 90.9% accurate, 1.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 6.2 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z, 0.5\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (<= y 6.2e+87)
                 (- x (/ 1.0 (fma 0.5 t (/ (/ t (expm1 z)) y))))
                 (-
                  x
                  (/ (log (fma (fma (* (fma 0.16666666666666666 z 0.5) y) z y) z 1.0)) t))))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if (y <= 6.2e+87) {
              		tmp = x - (1.0 / fma(0.5, t, ((t / expm1(z)) / y)));
              	} else {
              		tmp = x - (log(fma(fma((fma(0.16666666666666666, z, 0.5) * y), z, y), z, 1.0)) / t);
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if (y <= 6.2e+87)
              		tmp = Float64(x - Float64(1.0 / fma(0.5, t, Float64(Float64(t / expm1(z)) / y))));
              	else
              		tmp = Float64(x - Float64(log(fma(fma(Float64(fma(0.16666666666666666, z, 0.5) * y), z, y), z, 1.0)) / t));
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_] := If[LessEqual[y, 6.2e+87], N[(x - N[(1.0 / N[(0.5 * t + N[(N[(t / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(N[(N[(N[(0.16666666666666666 * z + 0.5), $MachinePrecision] * y), $MachinePrecision] * z + y), $MachinePrecision] * z + 1.0), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq 6.2 \cdot 10^{+87}:\\
              \;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\
              
              \mathbf{else}:\\
              \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z, 0.5\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < 6.1999999999999999e87

                1. Initial program 61.8%

                  \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                2. Add Preprocessing
                3. Taylor expanded in y around 0

                  \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                  2. lower-*.f64N/A

                    \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                  3. lower-expm1.f6485.6

                    \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
                5. Applied rewrites85.6%

                  \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
                6. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
                  2. clear-numN/A

                    \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                  3. lower-/.f64N/A

                    \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                  4. lower-/.f6485.6

                    \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                7. Applied rewrites85.6%

                  \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                8. Taylor expanded in y around 0

                  \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                9. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                  2. *-commutativeN/A

                    \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
                  3. lower-fma.f64N/A

                    \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
                  4. lower-*.f64N/A

                    \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
                  5. lower-/.f64N/A

                    \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
                  6. lower-expm1.f6491.8

                    \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
                10. Applied rewrites91.8%

                  \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
                11. Taylor expanded in y around inf

                  \[\leadsto x - \frac{1}{\frac{1}{2} \cdot t + \color{blue}{\frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
                12. Step-by-step derivation
                  1. Applied rewrites92.7%

                    \[\leadsto x - \frac{1}{\mathsf{fma}\left(0.5, \color{blue}{t}, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)} \]

                  if 6.1999999999999999e87 < y

                  1. Initial program 13.4%

                    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                  2. Add Preprocessing
                  3. Taylor expanded in z around 0

                    \[\leadsto x - \frac{\log \color{blue}{\left(1 + z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right)\right)}}{t} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto x - \frac{\log \color{blue}{\left(z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right) + 1\right)}}{t} \]
                    2. *-commutativeN/A

                      \[\leadsto x - \frac{\log \left(\color{blue}{\left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right)\right) \cdot z} + 1\right)}{t} \]
                    3. lower-fma.f64N/A

                      \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(y + z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right), z, 1\right)\right)}}{t} \]
                    4. +-commutativeN/A

                      \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{z \cdot \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right) + y}, z, 1\right)\right)}{t} \]
                    5. *-commutativeN/A

                      \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y\right) \cdot z} + y, z, 1\right)\right)}{t} \]
                    6. lower-fma.f64N/A

                      \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{6} \cdot \left(y \cdot z\right) + \frac{1}{2} \cdot y, z, y\right)}, z, 1\right)\right)}{t} \]
                    7. *-commutativeN/A

                      \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6} \cdot \color{blue}{\left(z \cdot y\right)} + \frac{1}{2} \cdot y, z, y\right), z, 1\right)\right)}{t} \]
                    8. associate-*r*N/A

                      \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(\frac{1}{6} \cdot z\right) \cdot y} + \frac{1}{2} \cdot y, z, y\right), z, 1\right)\right)}{t} \]
                    9. distribute-rgt-outN/A

                      \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{y \cdot \left(\frac{1}{6} \cdot z + \frac{1}{2}\right)}, z, y\right), z, 1\right)\right)}{t} \]
                    10. lower-*.f64N/A

                      \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{y \cdot \left(\frac{1}{6} \cdot z + \frac{1}{2}\right)}, z, y\right), z, 1\right)\right)}{t} \]
                    11. lower-fma.f6491.0

                      \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot \color{blue}{\mathsf{fma}\left(0.16666666666666666, z, 0.5\right)}, z, y\right), z, 1\right)\right)}{t} \]
                  5. Applied rewrites91.0%

                    \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot \mathsf{fma}\left(0.16666666666666666, z, 0.5\right), z, y\right), z, 1\right)\right)}}{t} \]
                13. Recombined 2 regimes into one program.
                14. Final simplification92.5%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.2 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{1}{\mathsf{fma}\left(0.5, t, \frac{\frac{t}{\mathsf{expm1}\left(z\right)}}{y}\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z, 0.5\right) \cdot y, z, y\right), z, 1\right)\right)}{t}\\ \end{array} \]
                15. Add Preprocessing

                Alternative 6: 90.3% accurate, 1.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, z \cdot y, y\right), z, 1\right)\right)}{t}\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (if (<= y -5.4e+18)
                   (- x (/ 1.0 (/ (/ (fma (* 0.5 z) (- (* t y) t) t) z) y)))
                   (if (<= y 4.5e+87)
                     (- x (* (/ (expm1 z) t) y))
                     (- x (/ (log (fma (fma 0.5 (* z y) y) z 1.0)) t)))))
                double code(double x, double y, double z, double t) {
                	double tmp;
                	if (y <= -5.4e+18) {
                		tmp = x - (1.0 / ((fma((0.5 * z), ((t * y) - t), t) / z) / y));
                	} else if (y <= 4.5e+87) {
                		tmp = x - ((expm1(z) / t) * y);
                	} else {
                		tmp = x - (log(fma(fma(0.5, (z * y), y), z, 1.0)) / t);
                	}
                	return tmp;
                }
                
                function code(x, y, z, t)
                	tmp = 0.0
                	if (y <= -5.4e+18)
                		tmp = Float64(x - Float64(1.0 / Float64(Float64(fma(Float64(0.5 * z), Float64(Float64(t * y) - t), t) / z) / y)));
                	elseif (y <= 4.5e+87)
                		tmp = Float64(x - Float64(Float64(expm1(z) / t) * y));
                	else
                		tmp = Float64(x - Float64(log(fma(fma(0.5, Float64(z * y), y), z, 1.0)) / t));
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_] := If[LessEqual[y, -5.4e+18], N[(x - N[(1.0 / N[(N[(N[(N[(0.5 * z), $MachinePrecision] * N[(N[(t * y), $MachinePrecision] - t), $MachinePrecision] + t), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+87], N[(x - N[(N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(N[(0.5 * N[(z * y), $MachinePrecision] + y), $MachinePrecision] * z + 1.0), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\
                \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\
                
                \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\
                \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\
                
                \mathbf{else}:\\
                \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, z \cdot y, y\right), z, 1\right)\right)}{t}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if y < -5.4e18

                  1. Initial program 39.7%

                    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                  2. Add Preprocessing
                  3. Taylor expanded in y around 0

                    \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                    2. lower-*.f64N/A

                      \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                    3. lower-expm1.f6461.7

                      \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
                  5. Applied rewrites61.7%

                    \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
                  6. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
                    2. clear-numN/A

                      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                    3. lower-/.f64N/A

                      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                    4. lower-/.f6461.7

                      \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                  7. Applied rewrites61.7%

                    \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                  8. Taylor expanded in y around 0

                    \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                  9. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                    2. *-commutativeN/A

                      \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
                    3. lower-fma.f64N/A

                      \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
                    4. lower-*.f64N/A

                      \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
                    5. lower-/.f64N/A

                      \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
                    6. lower-expm1.f6473.8

                      \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
                  10. Applied rewrites73.8%

                    \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
                  11. Taylor expanded in z around 0

                    \[\leadsto x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}} \]
                  12. Step-by-step derivation
                    1. Applied rewrites76.1%

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

                    if -5.4e18 < y < 4.5000000000000003e87

                    1. Initial program 71.0%

                      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                    2. Add Preprocessing
                    3. Taylor expanded in y around 0

                      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
                    4. Step-by-step derivation
                      1. associate-/l*N/A

                        \[\leadsto x - \color{blue}{y \cdot \frac{e^{z} - 1}{t}} \]
                      2. div-subN/A

                        \[\leadsto x - y \cdot \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right)} \]
                      3. *-commutativeN/A

                        \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                      4. lower-*.f64N/A

                        \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                      5. div-subN/A

                        \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                      6. lower-/.f64N/A

                        \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                      7. lower-expm1.f6498.9

                        \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t} \cdot y \]
                    5. Applied rewrites98.9%

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

                    if 4.5000000000000003e87 < y

                    1. Initial program 13.4%

                      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                    2. Add Preprocessing
                    3. Taylor expanded in z around 0

                      \[\leadsto x - \frac{\log \color{blue}{\left(1 + z \cdot \left(y + \frac{1}{2} \cdot \left(y \cdot z\right)\right)\right)}}{t} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto x - \frac{\log \color{blue}{\left(z \cdot \left(y + \frac{1}{2} \cdot \left(y \cdot z\right)\right) + 1\right)}}{t} \]
                      2. *-commutativeN/A

                        \[\leadsto x - \frac{\log \left(\color{blue}{\left(y + \frac{1}{2} \cdot \left(y \cdot z\right)\right) \cdot z} + 1\right)}{t} \]
                      3. lower-fma.f64N/A

                        \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(y + \frac{1}{2} \cdot \left(y \cdot z\right), z, 1\right)\right)}}{t} \]
                      4. +-commutativeN/A

                        \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot \left(y \cdot z\right) + y}, z, 1\right)\right)}{t} \]
                      5. lower-fma.f64N/A

                        \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{2}, y \cdot z, y\right)}, z, 1\right)\right)}{t} \]
                      6. *-commutativeN/A

                        \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{2}, \color{blue}{z \cdot y}, y\right), z, 1\right)\right)}{t} \]
                      7. lower-*.f6491.0

                        \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, \color{blue}{z \cdot y}, y\right), z, 1\right)\right)}{t} \]
                    5. Applied rewrites91.0%

                      \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, z \cdot y, y\right), z, 1\right)\right)}}{t} \]
                  13. Recombined 3 regimes into one program.
                  14. Add Preprocessing

                  Alternative 7: 90.3% accurate, 1.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(z, y, 1\right)\right)}{t}\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= y -5.4e+18)
                     (- x (/ 1.0 (/ (/ (fma (* 0.5 z) (- (* t y) t) t) z) y)))
                     (if (<= y 4.5e+87)
                       (- x (* (/ (expm1 z) t) y))
                       (- x (/ (log (fma z y 1.0)) t)))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (y <= -5.4e+18) {
                  		tmp = x - (1.0 / ((fma((0.5 * z), ((t * y) - t), t) / z) / y));
                  	} else if (y <= 4.5e+87) {
                  		tmp = x - ((expm1(z) / t) * y);
                  	} else {
                  		tmp = x - (log(fma(z, y, 1.0)) / t);
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (y <= -5.4e+18)
                  		tmp = Float64(x - Float64(1.0 / Float64(Float64(fma(Float64(0.5 * z), Float64(Float64(t * y) - t), t) / z) / y)));
                  	elseif (y <= 4.5e+87)
                  		tmp = Float64(x - Float64(Float64(expm1(z) / t) * y));
                  	else
                  		tmp = Float64(x - Float64(log(fma(z, y, 1.0)) / t));
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[y, -5.4e+18], N[(x - N[(1.0 / N[(N[(N[(N[(0.5 * z), $MachinePrecision] * N[(N[(t * y), $MachinePrecision] - t), $MachinePrecision] + t), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+87], N[(x - N[(N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(z * y + 1.0), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\
                  \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\
                  
                  \mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\
                  \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(z, y, 1\right)\right)}{t}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if y < -5.4e18

                    1. Initial program 39.7%

                      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                    2. Add Preprocessing
                    3. Taylor expanded in y around 0

                      \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                      2. lower-*.f64N/A

                        \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                      3. lower-expm1.f6461.7

                        \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
                    5. Applied rewrites61.7%

                      \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
                    6. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
                      2. clear-numN/A

                        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                      3. lower-/.f64N/A

                        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                      4. lower-/.f6461.7

                        \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                    7. Applied rewrites61.7%

                      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                    8. Taylor expanded in y around 0

                      \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                    9. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                      2. *-commutativeN/A

                        \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
                      3. lower-fma.f64N/A

                        \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
                      4. lower-*.f64N/A

                        \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
                      5. lower-/.f64N/A

                        \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
                      6. lower-expm1.f6473.8

                        \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
                    10. Applied rewrites73.8%

                      \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
                    11. Taylor expanded in z around 0

                      \[\leadsto x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}} \]
                    12. Step-by-step derivation
                      1. Applied rewrites76.1%

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

                      if -5.4e18 < y < 4.5000000000000003e87

                      1. Initial program 71.0%

                        \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                      2. Add Preprocessing
                      3. Taylor expanded in y around 0

                        \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
                      4. Step-by-step derivation
                        1. associate-/l*N/A

                          \[\leadsto x - \color{blue}{y \cdot \frac{e^{z} - 1}{t}} \]
                        2. div-subN/A

                          \[\leadsto x - y \cdot \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                        4. lower-*.f64N/A

                          \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                        5. div-subN/A

                          \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                        6. lower-/.f64N/A

                          \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                        7. lower-expm1.f6498.9

                          \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t} \cdot y \]
                      5. Applied rewrites98.9%

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

                      if 4.5000000000000003e87 < y

                      1. Initial program 13.4%

                        \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                      2. Add Preprocessing
                      3. Taylor expanded in z around 0

                        \[\leadsto x - \frac{\log \color{blue}{\left(1 + y \cdot z\right)}}{t} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto x - \frac{\log \color{blue}{\left(y \cdot z + 1\right)}}{t} \]
                        2. *-commutativeN/A

                          \[\leadsto x - \frac{\log \left(\color{blue}{z \cdot y} + 1\right)}{t} \]
                        3. lower-fma.f6491.0

                          \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(z, y, 1\right)\right)}}{t} \]
                      5. Applied rewrites91.0%

                        \[\leadsto x - \frac{\log \color{blue}{\left(\mathsf{fma}\left(z, y, 1\right)\right)}}{t} \]
                    13. Recombined 3 regimes into one program.
                    14. Add Preprocessing

                    Alternative 8: 88.8% accurate, 1.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (if (<= y -5.4e+18)
                       (- x (/ 1.0 (/ (/ (fma (* 0.5 z) (- (* t y) t) t) z) y)))
                       (- x (* (/ (expm1 z) t) y))))
                    double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if (y <= -5.4e+18) {
                    		tmp = x - (1.0 / ((fma((0.5 * z), ((t * y) - t), t) / z) / y));
                    	} else {
                    		tmp = x - ((expm1(z) / t) * y);
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t)
                    	tmp = 0.0
                    	if (y <= -5.4e+18)
                    		tmp = Float64(x - Float64(1.0 / Float64(Float64(fma(Float64(0.5 * z), Float64(Float64(t * y) - t), t) / z) / y)));
                    	else
                    		tmp = Float64(x - Float64(Float64(expm1(z) / t) * y));
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_] := If[LessEqual[y, -5.4e+18], N[(x - N[(1.0 / N[(N[(N[(N[(0.5 * z), $MachinePrecision] * N[(N[(t * y), $MachinePrecision] - t), $MachinePrecision] + t), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;y \leq -5.4 \cdot 10^{+18}:\\
                    \;\;\;\;x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{t} \cdot y\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if y < -5.4e18

                      1. Initial program 39.7%

                        \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                      2. Add Preprocessing
                      3. Taylor expanded in y around 0

                        \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                        2. lower-*.f64N/A

                          \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                        3. lower-expm1.f6461.7

                          \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
                      5. Applied rewrites61.7%

                        \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
                      6. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
                        2. clear-numN/A

                          \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                        3. lower-/.f64N/A

                          \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                        4. lower-/.f6461.7

                          \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                      7. Applied rewrites61.7%

                        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                      8. Taylor expanded in y around 0

                        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                      9. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                        2. *-commutativeN/A

                          \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
                        3. lower-fma.f64N/A

                          \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
                        4. lower-*.f64N/A

                          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
                        5. lower-/.f64N/A

                          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
                        6. lower-expm1.f6473.8

                          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
                      10. Applied rewrites73.8%

                        \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
                      11. Taylor expanded in z around 0

                        \[\leadsto x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}} \]
                      12. Step-by-step derivation
                        1. Applied rewrites76.1%

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

                        if -5.4e18 < y

                        1. Initial program 64.6%

                          \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                        2. Add Preprocessing
                        3. Taylor expanded in y around 0

                          \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
                        4. Step-by-step derivation
                          1. associate-/l*N/A

                            \[\leadsto x - \color{blue}{y \cdot \frac{e^{z} - 1}{t}} \]
                          2. div-subN/A

                            \[\leadsto x - y \cdot \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right)} \]
                          3. *-commutativeN/A

                            \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                          4. lower-*.f64N/A

                            \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                          5. div-subN/A

                            \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                          6. lower-/.f64N/A

                            \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                          7. lower-expm1.f6494.1

                            \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t} \cdot y \]
                        5. Applied rewrites94.1%

                          \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right)}{t} \cdot y} \]
                      13. Recombined 2 regimes into one program.
                      14. Add Preprocessing

                      Alternative 9: 84.8% accurate, 4.0× speedup?

                      \[\begin{array}{l} \\ x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (- x (/ 1.0 (/ (/ (fma (* 0.5 z) (- (* t y) t) t) z) y))))
                      double code(double x, double y, double z, double t) {
                      	return x - (1.0 / ((fma((0.5 * z), ((t * y) - t), t) / z) / y));
                      }
                      
                      function code(x, y, z, t)
                      	return Float64(x - Float64(1.0 / Float64(Float64(fma(Float64(0.5 * z), Float64(Float64(t * y) - t), t) / z) / y)))
                      end
                      
                      code[x_, y_, z_, t_] := N[(x - N[(1.0 / N[(N[(N[(N[(0.5 * z), $MachinePrecision] * N[(N[(t * y), $MachinePrecision] - t), $MachinePrecision] + t), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}}
                      \end{array}
                      
                      Derivation
                      1. Initial program 57.9%

                        \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                      2. Add Preprocessing
                      3. Taylor expanded in y around 0

                        \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                        2. lower-*.f64N/A

                          \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                        3. lower-expm1.f6483.2

                          \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
                      5. Applied rewrites83.2%

                        \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
                      6. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
                        2. clear-numN/A

                          \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                        3. lower-/.f64N/A

                          \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                        4. lower-/.f6483.2

                          \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                      7. Applied rewrites83.2%

                        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                      8. Taylor expanded in y around 0

                        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                      9. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                        2. *-commutativeN/A

                          \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
                        3. lower-fma.f64N/A

                          \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
                        4. lower-*.f64N/A

                          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
                        5. lower-/.f64N/A

                          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
                        6. lower-expm1.f6489.3

                          \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
                      10. Applied rewrites89.3%

                        \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
                      11. Taylor expanded in z around 0

                        \[\leadsto x - \frac{1}{\frac{\frac{t + z \cdot \left(\frac{1}{2} \cdot \left(t \cdot y\right) - \frac{1}{2} \cdot t\right)}{z}}{y}} \]
                      12. Step-by-step derivation
                        1. Applied rewrites84.4%

                          \[\leadsto x - \frac{1}{\frac{\frac{\mathsf{fma}\left(0.5 \cdot z, t \cdot y - t, t\right)}{z}}{y}} \]
                        2. Add Preprocessing

                        Alternative 10: 81.6% accurate, 5.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.55 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{t} - \frac{1}{t}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z}{t} \cdot y\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (<= z -3.55e+19) (fma (- (/ 1.0 t) (/ 1.0 t)) y x) (- x (* (/ z t) y))))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if (z <= -3.55e+19) {
                        		tmp = fma(((1.0 / t) - (1.0 / t)), y, x);
                        	} else {
                        		tmp = x - ((z / t) * y);
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if (z <= -3.55e+19)
                        		tmp = fma(Float64(Float64(1.0 / t) - Float64(1.0 / t)), y, x);
                        	else
                        		tmp = Float64(x - Float64(Float64(z / t) * y));
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_, z_, t_] := If[LessEqual[z, -3.55e+19], N[(N[(N[(1.0 / t), $MachinePrecision] - N[(1.0 / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(x - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;z \leq -3.55 \cdot 10^{+19}:\\
                        \;\;\;\;\mathsf{fma}\left(\frac{1}{t} - \frac{1}{t}, y, x\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;x - \frac{z}{t} \cdot y\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if z < -3.55e19

                          1. Initial program 79.2%

                            \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                          2. Add Preprocessing
                          3. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{x + y \cdot \left(\frac{1}{t} - \frac{e^{z}}{t}\right)} \]
                          4. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \color{blue}{y \cdot \left(\frac{1}{t} - \frac{e^{z}}{t}\right) + x} \]
                            2. *-commutativeN/A

                              \[\leadsto \color{blue}{\left(\frac{1}{t} - \frac{e^{z}}{t}\right) \cdot y} + x \]
                            3. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{t} - \frac{e^{z}}{t}, y, x\right)} \]
                            4. lower--.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{t} - \frac{e^{z}}{t}}, y, x\right) \]
                            5. lower-/.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{t}} - \frac{e^{z}}{t}, y, x\right) \]
                            6. lower-/.f64N/A

                              \[\leadsto \mathsf{fma}\left(\frac{1}{t} - \color{blue}{\frac{e^{z}}{t}}, y, x\right) \]
                            7. lower-exp.f6475.3

                              \[\leadsto \mathsf{fma}\left(\frac{1}{t} - \frac{\color{blue}{e^{z}}}{t}, y, x\right) \]
                          5. Applied rewrites75.3%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{t} - \frac{e^{z}}{t}, y, x\right)} \]
                          6. Taylor expanded in z around 0

                            \[\leadsto \mathsf{fma}\left(\frac{1}{t} - \frac{1}{t}, y, x\right) \]
                          7. Step-by-step derivation
                            1. Applied rewrites62.2%

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

                            if -3.55e19 < z

                            1. Initial program 49.2%

                              \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                            2. Add Preprocessing
                            3. Taylor expanded in y around 0

                              \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
                            4. Step-by-step derivation
                              1. associate-/l*N/A

                                \[\leadsto x - \color{blue}{y \cdot \frac{e^{z} - 1}{t}} \]
                              2. div-subN/A

                                \[\leadsto x - y \cdot \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right)} \]
                              3. *-commutativeN/A

                                \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                              4. lower-*.f64N/A

                                \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                              5. div-subN/A

                                \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                              6. lower-/.f64N/A

                                \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                              7. lower-expm1.f6489.5

                                \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t} \cdot y \]
                            5. Applied rewrites89.5%

                              \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right)}{t} \cdot y} \]
                            6. Taylor expanded in z around 0

                              \[\leadsto x - \frac{z}{t} \cdot y \]
                            7. Step-by-step derivation
                              1. Applied rewrites89.5%

                                \[\leadsto x - \frac{z}{t} \cdot y \]
                            8. Recombined 2 regimes into one program.
                            9. Add Preprocessing

                            Alternative 11: 78.3% accurate, 8.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+19}:\\ \;\;\;\;x - \frac{1}{0.5 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z}{t} \cdot y\\ \end{array} \end{array} \]
                            (FPCore (x y z t)
                             :precision binary64
                             (if (<= z -5e+19) (- x (/ 1.0 (* 0.5 t))) (- x (* (/ z t) y))))
                            double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (z <= -5e+19) {
                            		tmp = x - (1.0 / (0.5 * t));
                            	} else {
                            		tmp = x - ((z / t) * y);
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(x, y, z, t)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8) :: tmp
                                if (z <= (-5d+19)) then
                                    tmp = x - (1.0d0 / (0.5d0 * t))
                                else
                                    tmp = x - ((z / t) * y)
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (z <= -5e+19) {
                            		tmp = x - (1.0 / (0.5 * t));
                            	} else {
                            		tmp = x - ((z / t) * y);
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t):
                            	tmp = 0
                            	if z <= -5e+19:
                            		tmp = x - (1.0 / (0.5 * t))
                            	else:
                            		tmp = x - ((z / t) * y)
                            	return tmp
                            
                            function code(x, y, z, t)
                            	tmp = 0.0
                            	if (z <= -5e+19)
                            		tmp = Float64(x - Float64(1.0 / Float64(0.5 * t)));
                            	else
                            		tmp = Float64(x - Float64(Float64(z / t) * y));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t)
                            	tmp = 0.0;
                            	if (z <= -5e+19)
                            		tmp = x - (1.0 / (0.5 * t));
                            	else
                            		tmp = x - ((z / t) * y);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_] := If[LessEqual[z, -5e+19], N[(x - N[(1.0 / N[(0.5 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;z \leq -5 \cdot 10^{+19}:\\
                            \;\;\;\;x - \frac{1}{0.5 \cdot t}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;x - \frac{z}{t} \cdot y\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if z < -5e19

                              1. Initial program 79.2%

                                \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                              2. Add Preprocessing
                              3. Taylor expanded in y around 0

                                \[\leadsto x - \frac{\color{blue}{y \cdot \left(e^{z} - 1\right)}}{t} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                                2. lower-*.f64N/A

                                  \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
                                3. lower-expm1.f6475.4

                                  \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
                              5. Applied rewrites75.4%

                                \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
                              6. Step-by-step derivation
                                1. lift-/.f64N/A

                                  \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right) \cdot y}{t}} \]
                                2. clear-numN/A

                                  \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                                3. lower-/.f64N/A

                                  \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                                4. lower-/.f6475.3

                                  \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                              7. Applied rewrites75.3%

                                \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{expm1}\left(z\right) \cdot y}}} \]
                              8. Taylor expanded in y around 0

                                \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                              9. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \left(t \cdot y\right) + \frac{t}{e^{z} - 1}}{y}}} \]
                                2. *-commutativeN/A

                                  \[\leadsto x - \frac{1}{\frac{\color{blue}{\left(t \cdot y\right) \cdot \frac{1}{2}} + \frac{t}{e^{z} - 1}}{y}} \]
                                3. lower-fma.f64N/A

                                  \[\leadsto x - \frac{1}{\frac{\color{blue}{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}}{y}} \]
                                4. lower-*.f64N/A

                                  \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\color{blue}{t \cdot y}, \frac{1}{2}, \frac{t}{e^{z} - 1}\right)}{y}} \]
                                5. lower-/.f64N/A

                                  \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, \frac{1}{2}, \color{blue}{\frac{t}{e^{z} - 1}}\right)}{y}} \]
                                6. lower-expm1.f6486.1

                                  \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}\right)}{y}} \]
                              10. Applied rewrites86.1%

                                \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(t \cdot y, 0.5, \frac{t}{\mathsf{expm1}\left(z\right)}\right)}{y}}} \]
                              11. Taylor expanded in y around inf

                                \[\leadsto x - \frac{1}{\frac{1}{2} \cdot \color{blue}{t}} \]
                              12. Step-by-step derivation
                                1. Applied rewrites47.6%

                                  \[\leadsto x - \frac{1}{0.5 \cdot \color{blue}{t}} \]

                                if -5e19 < z

                                1. Initial program 49.2%

                                  \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                                2. Add Preprocessing
                                3. Taylor expanded in y around 0

                                  \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
                                4. Step-by-step derivation
                                  1. associate-/l*N/A

                                    \[\leadsto x - \color{blue}{y \cdot \frac{e^{z} - 1}{t}} \]
                                  2. div-subN/A

                                    \[\leadsto x - y \cdot \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right)} \]
                                  3. *-commutativeN/A

                                    \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                                  4. lower-*.f64N/A

                                    \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                                  5. div-subN/A

                                    \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                                  6. lower-/.f64N/A

                                    \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                                  7. lower-expm1.f6489.5

                                    \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t} \cdot y \]
                                5. Applied rewrites89.5%

                                  \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right)}{t} \cdot y} \]
                                6. Taylor expanded in z around 0

                                  \[\leadsto x - \frac{z}{t} \cdot y \]
                                7. Step-by-step derivation
                                  1. Applied rewrites89.5%

                                    \[\leadsto x - \frac{z}{t} \cdot y \]
                                8. Recombined 2 regimes into one program.
                                9. Add Preprocessing

                                Alternative 12: 74.0% accurate, 11.3× speedup?

                                \[\begin{array}{l} \\ x - \frac{z}{t} \cdot y \end{array} \]
                                (FPCore (x y z t) :precision binary64 (- x (* (/ z t) y)))
                                double code(double x, double y, double z, double t) {
                                	return x - ((z / t) * y);
                                }
                                
                                real(8) function code(x, y, z, t)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    code = x - ((z / t) * y)
                                end function
                                
                                public static double code(double x, double y, double z, double t) {
                                	return x - ((z / t) * y);
                                }
                                
                                def code(x, y, z, t):
                                	return x - ((z / t) * y)
                                
                                function code(x, y, z, t)
                                	return Float64(x - Float64(Float64(z / t) * y))
                                end
                                
                                function tmp = code(x, y, z, t)
                                	tmp = x - ((z / t) * y);
                                end
                                
                                code[x_, y_, z_, t_] := N[(x - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
                                
                                \begin{array}{l}
                                
                                \\
                                x - \frac{z}{t} \cdot y
                                \end{array}
                                
                                Derivation
                                1. Initial program 57.9%

                                  \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                                2. Add Preprocessing
                                3. Taylor expanded in y around 0

                                  \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
                                4. Step-by-step derivation
                                  1. associate-/l*N/A

                                    \[\leadsto x - \color{blue}{y \cdot \frac{e^{z} - 1}{t}} \]
                                  2. div-subN/A

                                    \[\leadsto x - y \cdot \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right)} \]
                                  3. *-commutativeN/A

                                    \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                                  4. lower-*.f64N/A

                                    \[\leadsto x - \color{blue}{\left(\frac{e^{z}}{t} - \frac{1}{t}\right) \cdot y} \]
                                  5. div-subN/A

                                    \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                                  6. lower-/.f64N/A

                                    \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{t}} \cdot y \]
                                  7. lower-expm1.f6485.4

                                    \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t} \cdot y \]
                                5. Applied rewrites85.4%

                                  \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right)}{t} \cdot y} \]
                                6. Taylor expanded in z around 0

                                  \[\leadsto x - \frac{z}{t} \cdot y \]
                                7. Step-by-step derivation
                                  1. Applied rewrites72.4%

                                    \[\leadsto x - \frac{z}{t} \cdot y \]
                                  2. Add Preprocessing

                                  Alternative 13: 72.5% accurate, 11.3× speedup?

                                  \[\begin{array}{l} \\ \mathsf{fma}\left(-z, \frac{y}{t}, x\right) \end{array} \]
                                  (FPCore (x y z t) :precision binary64 (fma (- z) (/ y t) x))
                                  double code(double x, double y, double z, double t) {
                                  	return fma(-z, (y / t), x);
                                  }
                                  
                                  function code(x, y, z, t)
                                  	return fma(Float64(-z), Float64(y / t), x)
                                  end
                                  
                                  code[x_, y_, z_, t_] := N[((-z) * N[(y / t), $MachinePrecision] + x), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \mathsf{fma}\left(-z, \frac{y}{t}, x\right)
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 57.9%

                                    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in z around 0

                                    \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{t}} \]
                                  4. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t} + x} \]
                                    2. mul-1-negN/A

                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot z}{t}\right)\right)} + x \]
                                    3. *-commutativeN/A

                                      \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{z \cdot y}}{t}\right)\right) + x \]
                                    4. associate-*r/N/A

                                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{z \cdot \frac{y}{t}}\right)\right) + x \]
                                    5. distribute-lft-neg-inN/A

                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \frac{y}{t}} + x \]
                                    6. mul-1-negN/A

                                      \[\leadsto \color{blue}{\left(-1 \cdot z\right)} \cdot \frac{y}{t} + x \]
                                    7. lower-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot z, \frac{y}{t}, x\right)} \]
                                    8. mul-1-negN/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, \frac{y}{t}, x\right) \]
                                    9. lower-neg.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, \frac{y}{t}, x\right) \]
                                    10. lower-/.f6471.7

                                      \[\leadsto \mathsf{fma}\left(-z, \color{blue}{\frac{y}{t}}, x\right) \]
                                  5. Applied rewrites71.7%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(-z, \frac{y}{t}, x\right)} \]
                                  6. Add Preprocessing

                                  Alternative 14: 14.9% accurate, 11.9× speedup?

                                  \[\begin{array}{l} \\ \frac{-z}{t} \cdot y \end{array} \]
                                  (FPCore (x y z t) :precision binary64 (* (/ (- z) t) y))
                                  double code(double x, double y, double z, double t) {
                                  	return (-z / t) * y;
                                  }
                                  
                                  real(8) function code(x, y, z, t)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      real(8), intent (in) :: z
                                      real(8), intent (in) :: t
                                      code = (-z / t) * y
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t) {
                                  	return (-z / t) * y;
                                  }
                                  
                                  def code(x, y, z, t):
                                  	return (-z / t) * y
                                  
                                  function code(x, y, z, t)
                                  	return Float64(Float64(Float64(-z) / t) * y)
                                  end
                                  
                                  function tmp = code(x, y, z, t)
                                  	tmp = (-z / t) * y;
                                  end
                                  
                                  code[x_, y_, z_, t_] := N[(N[((-z) / t), $MachinePrecision] * y), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \frac{-z}{t} \cdot y
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 57.9%

                                    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in z around 0

                                    \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{t}} \]
                                  4. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t} + x} \]
                                    2. mul-1-negN/A

                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot z}{t}\right)\right)} + x \]
                                    3. *-commutativeN/A

                                      \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{z \cdot y}}{t}\right)\right) + x \]
                                    4. associate-*r/N/A

                                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{z \cdot \frac{y}{t}}\right)\right) + x \]
                                    5. distribute-lft-neg-inN/A

                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \frac{y}{t}} + x \]
                                    6. mul-1-negN/A

                                      \[\leadsto \color{blue}{\left(-1 \cdot z\right)} \cdot \frac{y}{t} + x \]
                                    7. lower-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot z, \frac{y}{t}, x\right)} \]
                                    8. mul-1-negN/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, \frac{y}{t}, x\right) \]
                                    9. lower-neg.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, \frac{y}{t}, x\right) \]
                                    10. lower-/.f6471.7

                                      \[\leadsto \mathsf{fma}\left(-z, \color{blue}{\frac{y}{t}}, x\right) \]
                                  5. Applied rewrites71.7%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(-z, \frac{y}{t}, x\right)} \]
                                  6. Taylor expanded in t around 0

                                    \[\leadsto -1 \cdot \color{blue}{\frac{y \cdot z}{t}} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites15.3%

                                      \[\leadsto \frac{-z}{t} \cdot \color{blue}{y} \]
                                    2. Add Preprocessing

                                    Alternative 15: 13.2% accurate, 11.9× speedup?

                                    \[\begin{array}{l} \\ \frac{-y}{t} \cdot z \end{array} \]
                                    (FPCore (x y z t) :precision binary64 (* (/ (- y) t) z))
                                    double code(double x, double y, double z, double t) {
                                    	return (-y / t) * z;
                                    }
                                    
                                    real(8) function code(x, y, z, t)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        real(8), intent (in) :: z
                                        real(8), intent (in) :: t
                                        code = (-y / t) * z
                                    end function
                                    
                                    public static double code(double x, double y, double z, double t) {
                                    	return (-y / t) * z;
                                    }
                                    
                                    def code(x, y, z, t):
                                    	return (-y / t) * z
                                    
                                    function code(x, y, z, t)
                                    	return Float64(Float64(Float64(-y) / t) * z)
                                    end
                                    
                                    function tmp = code(x, y, z, t)
                                    	tmp = (-y / t) * z;
                                    end
                                    
                                    code[x_, y_, z_, t_] := N[(N[((-y) / t), $MachinePrecision] * z), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \frac{-y}{t} \cdot z
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 57.9%

                                      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in z around 0

                                      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot z}{t}} \]
                                    4. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t} + x} \]
                                      2. mul-1-negN/A

                                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot z}{t}\right)\right)} + x \]
                                      3. *-commutativeN/A

                                        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{z \cdot y}}{t}\right)\right) + x \]
                                      4. associate-*r/N/A

                                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{z \cdot \frac{y}{t}}\right)\right) + x \]
                                      5. distribute-lft-neg-inN/A

                                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \frac{y}{t}} + x \]
                                      6. mul-1-negN/A

                                        \[\leadsto \color{blue}{\left(-1 \cdot z\right)} \cdot \frac{y}{t} + x \]
                                      7. lower-fma.f64N/A

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot z, \frac{y}{t}, x\right)} \]
                                      8. mul-1-negN/A

                                        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(z\right)}, \frac{y}{t}, x\right) \]
                                      9. lower-neg.f64N/A

                                        \[\leadsto \mathsf{fma}\left(\color{blue}{-z}, \frac{y}{t}, x\right) \]
                                      10. lower-/.f6471.7

                                        \[\leadsto \mathsf{fma}\left(-z, \color{blue}{\frac{y}{t}}, x\right) \]
                                    5. Applied rewrites71.7%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-z, \frac{y}{t}, x\right)} \]
                                    6. Taylor expanded in t around 0

                                      \[\leadsto -1 \cdot \color{blue}{\frac{y \cdot z}{t}} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites15.3%

                                        \[\leadsto \frac{-z}{t} \cdot \color{blue}{y} \]
                                      2. Taylor expanded in t around 0

                                        \[\leadsto -1 \cdot \color{blue}{\frac{y \cdot z}{t}} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites14.7%

                                          \[\leadsto \frac{-y}{t} \cdot \color{blue}{z} \]
                                        2. Add Preprocessing

                                        Developer Target 1: 74.7% accurate, 1.8× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-0.5}{y \cdot t}\\ \mathbf{if}\;z < -2.8874623088207947 \cdot 10^{+119}:\\ \;\;\;\;\left(x - \frac{t\_1}{z \cdot z}\right) - t\_1 \cdot \frac{\frac{2}{z}}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(1 + z \cdot y\right)}{t}\\ \end{array} \end{array} \]
                                        (FPCore (x y z t)
                                         :precision binary64
                                         (let* ((t_1 (/ (- 0.5) (* y t))))
                                           (if (< z -2.8874623088207947e+119)
                                             (- (- x (/ t_1 (* z z))) (* t_1 (/ (/ 2.0 z) (* z z))))
                                             (- x (/ (log (+ 1.0 (* z y))) t)))))
                                        double code(double x, double y, double z, double t) {
                                        	double t_1 = -0.5 / (y * t);
                                        	double tmp;
                                        	if (z < -2.8874623088207947e+119) {
                                        		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
                                        	} else {
                                        		tmp = x - (log((1.0 + (z * y))) / t);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        real(8) function code(x, y, z, t)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            real(8), intent (in) :: z
                                            real(8), intent (in) :: t
                                            real(8) :: t_1
                                            real(8) :: tmp
                                            t_1 = -0.5d0 / (y * t)
                                            if (z < (-2.8874623088207947d+119)) then
                                                tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0d0 / z) / (z * z)))
                                            else
                                                tmp = x - (log((1.0d0 + (z * y))) / t)
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double x, double y, double z, double t) {
                                        	double t_1 = -0.5 / (y * t);
                                        	double tmp;
                                        	if (z < -2.8874623088207947e+119) {
                                        		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
                                        	} else {
                                        		tmp = x - (Math.log((1.0 + (z * y))) / t);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(x, y, z, t):
                                        	t_1 = -0.5 / (y * t)
                                        	tmp = 0
                                        	if z < -2.8874623088207947e+119:
                                        		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)))
                                        	else:
                                        		tmp = x - (math.log((1.0 + (z * y))) / t)
                                        	return tmp
                                        
                                        function code(x, y, z, t)
                                        	t_1 = Float64(Float64(-0.5) / Float64(y * t))
                                        	tmp = 0.0
                                        	if (z < -2.8874623088207947e+119)
                                        		tmp = Float64(Float64(x - Float64(t_1 / Float64(z * z))) - Float64(t_1 * Float64(Float64(2.0 / z) / Float64(z * z))));
                                        	else
                                        		tmp = Float64(x - Float64(log(Float64(1.0 + Float64(z * y))) / t));
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(x, y, z, t)
                                        	t_1 = -0.5 / (y * t);
                                        	tmp = 0.0;
                                        	if (z < -2.8874623088207947e+119)
                                        		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
                                        	else
                                        		tmp = x - (log((1.0 + (z * y))) / t);
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-0.5) / N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.8874623088207947e+119], N[(N[(x - N[(t$95$1 / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(N[(2.0 / z), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(1.0 + N[(z * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        t_1 := \frac{-0.5}{y \cdot t}\\
                                        \mathbf{if}\;z < -2.8874623088207947 \cdot 10^{+119}:\\
                                        \;\;\;\;\left(x - \frac{t\_1}{z \cdot z}\right) - t\_1 \cdot \frac{\frac{2}{z}}{z \cdot z}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;x - \frac{\log \left(1 + z \cdot y\right)}{t}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        

                                        Reproduce

                                        ?
                                        herbie shell --seed 2024254 
                                        (FPCore (x y z t)
                                          :name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
                                          :precision binary64
                                        
                                          :alt
                                          (! :herbie-platform default (if (< z -288746230882079470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- x (/ (/ (- 1/2) (* y t)) (* z z))) (* (/ (- 1/2) (* y t)) (/ (/ 2 z) (* z z)))) (- x (/ (log (+ 1 (* z y))) t))))
                                        
                                          (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))