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

Percentage Accurate: 61.4% → 98.6%
Time: 21.8s
Alternatives: 15
Speedup: 226.0×

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.4% 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: 98.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (- x (/ (log1p (* y (expm1 z))) t)))
double code(double x, double y, double z, double t) {
	return x - (log1p((y * expm1(z))) / t);
}
public static double code(double x, double y, double z, double t) {
	return x - (Math.log1p((y * Math.expm1(z))) / t);
}
def code(x, y, z, t):
	return x - (math.log1p((y * math.expm1(z))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log1p(Float64(y * expm1(z))) / t))
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[1 + N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}
\end{array}
Derivation
  1. Initial program 60.9%

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

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

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

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

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

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

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

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

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
    8. accelerator-lowering-expm1.f6499.6

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

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

Alternative 2: 94.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 50000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{t}, -y, x\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+117}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{-t}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, 0.5 \cdot \left(y \cdot \left(x \cdot t\right)\right)\right)}{y}}, -x, x\right)\\


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

    1. Initial program 2.3%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      8. accelerator-lowering-expm1.f6499.9

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

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

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot z}\right)}{t} \]
    7. Step-by-step derivation
      1. *-lowering-*.f6499.9

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot z}\right)}{t} \]
    8. Simplified99.9%

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

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

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      8. accelerator-lowering-expm1.f6499.3

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

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

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    7. 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. *-lowering-*.f64N/A

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

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

        \[\leadsto x - y \cdot \color{blue}{\frac{e^{z} - 1}{t}} \]
      6. accelerator-lowering-expm1.f6499.4

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t}, \mathsf{neg}\left(y\right), x\right) \]
      8. neg-lowering-neg.f6499.4

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{t}, \color{blue}{-y}, x\right) \]
    10. Applied egg-rr99.4%

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

    if 5e7 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 1.00000000000000005e117

    1. Initial program 97.7%

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

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

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

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

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

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

        \[\leadsto \frac{\log \color{blue}{\left(1 + \left(y \cdot e^{z} + \left(\mathsf{neg}\left(y\right)\right)\right)\right)}}{\mathsf{neg}\left(t\right)} \]
      6. *-rgt-identityN/A

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

        \[\leadsto \frac{\log \left(1 + \color{blue}{\left(y \cdot e^{z} - y \cdot 1\right)}\right)}{\mathsf{neg}\left(t\right)} \]
      8. distribute-lft-out--N/A

        \[\leadsto \frac{\log \left(1 + \color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{\mathsf{neg}\left(t\right)} \]
      9. accelerator-lowering-log1p.f64N/A

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

        \[\leadsto \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{\mathsf{neg}\left(t\right)} \]
      11. accelerator-lowering-expm1.f64N/A

        \[\leadsto \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{\mathsf{neg}\left(t\right)} \]
      12. neg-lowering-neg.f6476.4

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

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

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

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t \cdot x}, -x, x\right)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x}{\color{blue}{\frac{\log \left(1 + y \cdot \left(e^{z} - 1\right)\right)}{t}}}}, \mathsf{neg}\left(x\right), x\right) \]
      6. accelerator-lowering-log1p.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x}{\frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t}}}, \mathsf{neg}\left(x\right), x\right) \]
      8. accelerator-lowering-expm1.f6492.4

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x}{\frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t}}}, -x, x\right) \]
    7. Applied egg-rr92.4%

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\color{blue}{\frac{t \cdot x}{e^{z} - 1} + \frac{1}{2} \cdot \left(t \cdot \left(x \cdot y\right)\right)}}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      3. associate-/l*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\color{blue}{\mathsf{expm1}\left(z\right)}}, \frac{1}{2} \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      7. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, \frac{1}{2} \cdot \left(\color{blue}{\left(y \cdot x\right)} \cdot t\right)\right)}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      10. associate-*l*N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, \frac{1}{2} \cdot \left(y \cdot \color{blue}{\left(t \cdot x\right)}\right)\right)}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, \frac{1}{2} \cdot \color{blue}{\left(y \cdot \left(t \cdot x\right)\right)}\right)}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      13. *-lowering-*.f6468.5

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

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

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

Alternative 3: 94.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{t}, -y, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, 0.5 \cdot \left(y \cdot \left(x \cdot t\right)\right)\right)}{y}}, -x, x\right)\\


\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.3%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      8. accelerator-lowering-expm1.f6499.9

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

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

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot z}\right)}{t} \]
    7. Step-by-step derivation
      1. *-lowering-*.f6499.9

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot z}\right)}{t} \]
    8. Simplified99.9%

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

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

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      8. accelerator-lowering-expm1.f6499.3

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

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

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    7. 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. *-lowering-*.f64N/A

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

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

        \[\leadsto x - y \cdot \color{blue}{\frac{e^{z} - 1}{t}} \]
      6. accelerator-lowering-expm1.f6499.9

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t}, \mathsf{neg}\left(y\right), x\right) \]
      8. neg-lowering-neg.f6499.9

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

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

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

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t \cdot x}, -x, x\right)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x}{\color{blue}{\frac{\log \left(1 + y \cdot \left(e^{z} - 1\right)\right)}{t}}}}, \mathsf{neg}\left(x\right), x\right) \]
      6. accelerator-lowering-log1p.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x}{\frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t}}}, \mathsf{neg}\left(x\right), x\right) \]
      8. accelerator-lowering-expm1.f6487.0

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x}{\frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t}}}, -x, x\right) \]
    7. Applied egg-rr87.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\color{blue}{\frac{t \cdot x}{e^{z} - 1} + \frac{1}{2} \cdot \left(t \cdot \left(x \cdot y\right)\right)}}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      3. associate-/l*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\color{blue}{\mathsf{expm1}\left(z\right)}}, \frac{1}{2} \cdot \left(t \cdot \left(x \cdot y\right)\right)\right)}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      7. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, \frac{1}{2} \cdot \left(\color{blue}{\left(y \cdot x\right)} \cdot t\right)\right)}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      10. associate-*l*N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, \frac{1}{2} \cdot \left(y \cdot \color{blue}{\left(t \cdot x\right)}\right)\right)}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, \frac{1}{2} \cdot \color{blue}{\left(y \cdot \left(t \cdot x\right)\right)}\right)}{y}}, \mathsf{neg}\left(x\right), x\right) \]
      13. *-lowering-*.f6455.2

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

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

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

Alternative 4: 94.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{t}, -y, x\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\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.3%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      8. accelerator-lowering-expm1.f6499.9

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

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

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot z}\right)}{t} \]
    7. Step-by-step derivation
      1. *-lowering-*.f6499.9

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot z}\right)}{t} \]
    8. Simplified99.9%

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

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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      8. accelerator-lowering-expm1.f6499.4

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

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

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    7. 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. *-lowering-*.f64N/A

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

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

        \[\leadsto x - y \cdot \color{blue}{\frac{e^{z} - 1}{t}} \]
      6. accelerator-lowering-expm1.f6495.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{t}, \mathsf{neg}\left(y\right), x\right) \]
      8. neg-lowering-neg.f6495.3

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

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

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

    1. Initial program 98.3%

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

      \[\leadsto \color{blue}{x} \]
    4. Step-by-step derivation
      1. Simplified56.2%

        \[\leadsto \color{blue}{x} \]
    5. Recombined 3 regimes into one program.
    6. Add Preprocessing

    Alternative 5: 94.1% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - y\right) + y \cdot e^{z}\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\ \mathbf{elif}\;t\_1 \leq 10^{+63}:\\ \;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (+ (- 1.0 y) (* y (exp z)))))
       (if (<= t_1 0.0)
         (- x (/ (log1p (* y z)) t))
         (if (<= t_1 1e+63) (- x (* y (/ (expm1 z) t))) x))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (1.0 - y) + (y * exp(z));
    	double tmp;
    	if (t_1 <= 0.0) {
    		tmp = x - (log1p((y * z)) / t);
    	} else if (t_1 <= 1e+63) {
    		tmp = x - (y * (expm1(z) / t));
    	} else {
    		tmp = x;
    	}
    	return tmp;
    }
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = (1.0 - y) + (y * Math.exp(z));
    	double tmp;
    	if (t_1 <= 0.0) {
    		tmp = x - (Math.log1p((y * z)) / t);
    	} else if (t_1 <= 1e+63) {
    		tmp = x - (y * (Math.expm1(z) / t));
    	} else {
    		tmp = x;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = (1.0 - y) + (y * math.exp(z))
    	tmp = 0
    	if t_1 <= 0.0:
    		tmp = x - (math.log1p((y * z)) / t)
    	elif t_1 <= 1e+63:
    		tmp = x - (y * (math.expm1(z) / t))
    	else:
    		tmp = x
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(1.0 - y) + Float64(y * exp(z)))
    	tmp = 0.0
    	if (t_1 <= 0.0)
    		tmp = Float64(x - Float64(log1p(Float64(y * z)) / t));
    	elseif (t_1 <= 1e+63)
    		tmp = Float64(x - Float64(y * Float64(expm1(z) / t)));
    	else
    		tmp = x;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(x - N[(N[Log[1 + N[(y * z), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(x - N[(y * N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(1 - y\right) + y \cdot e^{z}\\
    \mathbf{if}\;t\_1 \leq 0:\\
    \;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\
    
    \mathbf{elif}\;t\_1 \leq 10^{+63}:\\
    \;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\
    
    \mathbf{else}:\\
    \;\;\;\;x\\
    
    
    \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.3%

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

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

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

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

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

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

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

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

          \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
        8. accelerator-lowering-expm1.f6499.9

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot z}\right)}{t} \]
      7. Step-by-step derivation
        1. *-lowering-*.f6499.9

          \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot z}\right)}{t} \]
      8. Simplified99.9%

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

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

      1. Initial program 79.3%

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

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

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

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

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

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

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

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

          \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
        8. accelerator-lowering-expm1.f6499.4

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

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

        \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
      7. 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. *-lowering-*.f64N/A

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

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

          \[\leadsto x - y \cdot \color{blue}{\frac{e^{z} - 1}{t}} \]
        6. accelerator-lowering-expm1.f6495.3

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

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

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

      1. Initial program 98.3%

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

        \[\leadsto \color{blue}{x} \]
      4. Step-by-step derivation
        1. Simplified56.2%

          \[\leadsto \color{blue}{x} \]
      5. Recombined 3 regimes into one program.
      6. Add Preprocessing

      Alternative 6: 88.3% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(1 - y\right) + y \cdot e^{z} \leq 10^{+63}:\\ \;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= (+ (- 1.0 y) (* y (exp z))) 1e+63) (- x (* y (/ (expm1 z) t))) x))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (((1.0 - y) + (y * exp(z))) <= 1e+63) {
      		tmp = x - (y * (expm1(z) / t));
      	} else {
      		tmp = x;
      	}
      	return tmp;
      }
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (((1.0 - y) + (y * Math.exp(z))) <= 1e+63) {
      		tmp = x - (y * (Math.expm1(z) / t));
      	} else {
      		tmp = x;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if ((1.0 - y) + (y * math.exp(z))) <= 1e+63:
      		tmp = x - (y * (math.expm1(z) / t))
      	else:
      		tmp = x
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (Float64(Float64(1.0 - y) + Float64(y * exp(z))) <= 1e+63)
      		tmp = Float64(x - Float64(y * Float64(expm1(z) / t)));
      	else
      		tmp = x;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+63], N[(x - N[(y * N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\left(1 - y\right) + y \cdot e^{z} \leq 10^{+63}:\\
      \;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;x\\
      
      
      \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.00000000000000006e63

        1. Initial program 55.6%

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

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

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

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

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

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

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

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

            \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
          8. accelerator-lowering-expm1.f6499.5

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

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

          \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
        7. 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. *-lowering-*.f64N/A

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

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

            \[\leadsto x - y \cdot \color{blue}{\frac{e^{z} - 1}{t}} \]
          6. accelerator-lowering-expm1.f6489.6

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

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

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

        1. Initial program 98.3%

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

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified56.2%

            \[\leadsto \color{blue}{x} \]
        5. Recombined 2 regimes into one program.
        6. Add Preprocessing

        Alternative 7: 81.4% accurate, 4.6× speedup?

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

          1. Initial program 77.6%

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

            \[\leadsto \color{blue}{x} \]
          4. Step-by-step derivation
            1. Simplified61.1%

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

            if -1.65e-69 < z

            1. Initial program 48.9%

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

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

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

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

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

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

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

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

                \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
              8. accelerator-lowering-expm1.f6499.4

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

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

              \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
            7. 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. *-lowering-*.f64N/A

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

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

                \[\leadsto x - y \cdot \color{blue}{\frac{e^{z} - 1}{t}} \]
              6. accelerator-lowering-expm1.f6492.4

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

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

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

                \[\leadsto x - y \cdot \frac{z \cdot \color{blue}{\left(z \cdot \left(\frac{1}{2} + z \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot z\right)\right) + 1\right)}}{t} \]
              2. distribute-lft-inN/A

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

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

                \[\leadsto x - y \cdot \frac{\color{blue}{{z}^{2}} \cdot \left(\frac{1}{2} + z \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot z\right)\right) + z \cdot 1}{t} \]
              5. *-rgt-identityN/A

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

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

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

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

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

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

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

                \[\leadsto x - y \cdot \frac{\mathsf{fma}\left(z \cdot z, \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{24}} + \frac{1}{6}, \frac{1}{2}\right), z\right)}{t} \]
              13. accelerator-lowering-fma.f6491.8

                \[\leadsto x - y \cdot \frac{\mathsf{fma}\left(z \cdot z, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.041666666666666664, 0.16666666666666666\right)}, 0.5\right), z\right)}{t} \]
            11. Simplified91.8%

              \[\leadsto x - y \cdot \frac{\color{blue}{\mathsf{fma}\left(z \cdot z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), z\right)}}{t} \]
          5. Recombined 2 regimes into one program.
          6. Add Preprocessing

          Alternative 8: 81.4% accurate, 5.3× speedup?

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

            1. Initial program 77.6%

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

              \[\leadsto \color{blue}{x} \]
            4. Step-by-step derivation
              1. Simplified61.1%

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

              if -1.10999999999999999e-69 < z

              1. Initial program 48.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 x - \frac{\color{blue}{z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(z \cdot \left(y + \left(-3 \cdot {y}^{2} + 2 \cdot {y}^{3}\right)\right)\right) + \frac{1}{2} \cdot \left(y + -1 \cdot {y}^{2}\right)\right)\right)}}{t} \]
              4. Step-by-step derivation
                1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{y \cdot \frac{z \cdot \left(1 + z \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot z\right)\right)}{t}}\right)\right) + x \]
                4. distribute-rgt-neg-inN/A

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\frac{z \cdot \left(1 + z \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot z\right)\right)}{t}\right), x\right)} \]
              8. Simplified91.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, z \cdot \mathsf{fma}\left(z, 0.16666666666666666, 0.5\right), z\right)}{-t}, x\right)} \]
            5. Recombined 2 regimes into one program.
            6. Add Preprocessing

            Alternative 9: 81.4% accurate, 6.5× speedup?

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

              1. Initial program 77.6%

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

                \[\leadsto \color{blue}{x} \]
              4. Step-by-step derivation
                1. Simplified61.1%

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

                if -1.65e-69 < z

                1. Initial program 48.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 \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. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(y, \color{blue}{z \cdot \left(\frac{-1}{2} \cdot \frac{z}{t} - \frac{1}{t}\right)}, x\right) \]
                7. Step-by-step derivation
                  1. associate-*r/N/A

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(y, \frac{z \cdot \left(z \cdot \frac{-1}{2} + \color{blue}{-1}\right)}{t}, x\right) \]
                  9. accelerator-lowering-fma.f6491.8

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

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

              Alternative 10: 70.3% accurate, 7.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-260}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-167}:\\ \;\;\;\;\frac{y \cdot z}{-t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (<= x -2.4e-260) x (if (<= x 8.2e-167) (/ (* y z) (- t)) x)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if (x <= -2.4e-260) {
              		tmp = x;
              	} else if (x <= 8.2e-167) {
              		tmp = (y * z) / -t;
              	} else {
              		tmp = x;
              	}
              	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 (x <= (-2.4d-260)) then
                      tmp = x
                  else if (x <= 8.2d-167) then
                      tmp = (y * z) / -t
                  else
                      tmp = x
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double tmp;
              	if (x <= -2.4e-260) {
              		tmp = x;
              	} else if (x <= 8.2e-167) {
              		tmp = (y * z) / -t;
              	} else {
              		tmp = x;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	tmp = 0
              	if x <= -2.4e-260:
              		tmp = x
              	elif x <= 8.2e-167:
              		tmp = (y * z) / -t
              	else:
              		tmp = x
              	return tmp
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if (x <= -2.4e-260)
              		tmp = x;
              	elseif (x <= 8.2e-167)
              		tmp = Float64(Float64(y * z) / Float64(-t));
              	else
              		tmp = x;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	tmp = 0.0;
              	if (x <= -2.4e-260)
              		tmp = x;
              	elseif (x <= 8.2e-167)
              		tmp = (y * z) / -t;
              	else
              		tmp = x;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := If[LessEqual[x, -2.4e-260], x, If[LessEqual[x, 8.2e-167], N[(N[(y * z), $MachinePrecision] / (-t)), $MachinePrecision], x]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq -2.4 \cdot 10^{-260}:\\
              \;\;\;\;x\\
              
              \mathbf{elif}\;x \leq 8.2 \cdot 10^{-167}:\\
              \;\;\;\;\frac{y \cdot z}{-t}\\
              
              \mathbf{else}:\\
              \;\;\;\;x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -2.4000000000000001e-260 or 8.20000000000000036e-167 < x

                1. Initial program 68.2%

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

                  \[\leadsto \color{blue}{x} \]
                4. Step-by-step derivation
                  1. Simplified78.4%

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

                  if -2.4000000000000001e-260 < x < 8.20000000000000036e-167

                  1. Initial program 16.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 x - \frac{\color{blue}{z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(z \cdot \left(y + \left(-3 \cdot {y}^{2} + 2 \cdot {y}^{3}\right)\right)\right) + \frac{1}{2} \cdot \left(y + -1 \cdot {y}^{2}\right)\right)\right)}}{t} \]
                  4. Step-by-step derivation
                    1. *-lowering-*.f64N/A

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

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

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

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

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

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

                      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
                    3. Step-by-step derivation
                      1. associate-*l/N/A

                        \[\leadsto -1 \cdot \color{blue}{\left(\frac{y}{t} \cdot z\right)} \]
                      2. associate-*l*N/A

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

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

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

                        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{y}{t}\right)\right)} \]
                      6. distribute-neg-frac2N/A

                        \[\leadsto z \cdot \color{blue}{\frac{y}{\mathsf{neg}\left(t\right)}} \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto z \cdot \color{blue}{\frac{y}{\mathsf{neg}\left(t\right)}} \]
                      8. neg-lowering-neg.f6447.4

                        \[\leadsto z \cdot \frac{y}{\color{blue}{-t}} \]
                    4. Simplified47.4%

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

                      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
                    6. Step-by-step derivation
                      1. associate-*r/N/A

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

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

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

                        \[\leadsto \frac{\color{blue}{\left(-1 \cdot z\right) \cdot y}}{t} \]
                      5. *-lowering-*.f64N/A

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

                        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot y}{t} \]
                      7. neg-lowering-neg.f6448.7

                        \[\leadsto \frac{\color{blue}{\left(-z\right)} \cdot y}{t} \]
                    7. Simplified48.7%

                      \[\leadsto \color{blue}{\frac{\left(-z\right) \cdot y}{t}} \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification74.2%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-260}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-167}:\\ \;\;\;\;\frac{y \cdot z}{-t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 11: 70.5% accurate, 7.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{-262}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-167}:\\ \;\;\;\;-z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= x -1.02e-262) x (if (<= x 3.2e-167) (- (* z (/ y t))) x)))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (x <= -1.02e-262) {
                  		tmp = x;
                  	} else if (x <= 3.2e-167) {
                  		tmp = -(z * (y / t));
                  	} else {
                  		tmp = x;
                  	}
                  	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 (x <= (-1.02d-262)) then
                          tmp = x
                      else if (x <= 3.2d-167) then
                          tmp = -(z * (y / t))
                      else
                          tmp = x
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (x <= -1.02e-262) {
                  		tmp = x;
                  	} else if (x <= 3.2e-167) {
                  		tmp = -(z * (y / t));
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if x <= -1.02e-262:
                  		tmp = x
                  	elif x <= 3.2e-167:
                  		tmp = -(z * (y / t))
                  	else:
                  		tmp = x
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (x <= -1.02e-262)
                  		tmp = x;
                  	elseif (x <= 3.2e-167)
                  		tmp = Float64(-Float64(z * Float64(y / t)));
                  	else
                  		tmp = x;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if (x <= -1.02e-262)
                  		tmp = x;
                  	elseif (x <= 3.2e-167)
                  		tmp = -(z * (y / t));
                  	else
                  		tmp = x;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[x, -1.02e-262], x, If[LessEqual[x, 3.2e-167], (-N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), x]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;x \leq -1.02 \cdot 10^{-262}:\\
                  \;\;\;\;x\\
                  
                  \mathbf{elif}\;x \leq 3.2 \cdot 10^{-167}:\\
                  \;\;\;\;-z \cdot \frac{y}{t}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < -1.01999999999999994e-262 or 3.2000000000000002e-167 < x

                    1. Initial program 68.2%

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

                      \[\leadsto \color{blue}{x} \]
                    4. Step-by-step derivation
                      1. Simplified78.4%

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

                      if -1.01999999999999994e-262 < x < 3.2000000000000002e-167

                      1. Initial program 16.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 x - \frac{\color{blue}{z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(z \cdot \left(y + \left(-3 \cdot {y}^{2} + 2 \cdot {y}^{3}\right)\right)\right) + \frac{1}{2} \cdot \left(y + -1 \cdot {y}^{2}\right)\right)\right)}}{t} \]
                      4. Step-by-step derivation
                        1. *-lowering-*.f64N/A

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

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

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

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

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

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

                          \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
                        3. Step-by-step derivation
                          1. associate-*l/N/A

                            \[\leadsto -1 \cdot \color{blue}{\left(\frac{y}{t} \cdot z\right)} \]
                          2. associate-*l*N/A

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

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

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

                            \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{y}{t}\right)\right)} \]
                          6. distribute-neg-frac2N/A

                            \[\leadsto z \cdot \color{blue}{\frac{y}{\mathsf{neg}\left(t\right)}} \]
                          7. /-lowering-/.f64N/A

                            \[\leadsto z \cdot \color{blue}{\frac{y}{\mathsf{neg}\left(t\right)}} \]
                          8. neg-lowering-neg.f6447.4

                            \[\leadsto z \cdot \frac{y}{\color{blue}{-t}} \]
                        4. Simplified47.4%

                          \[\leadsto \color{blue}{z \cdot \frac{y}{-t}} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification74.1%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{-262}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-167}:\\ \;\;\;\;-z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 12: 70.7% accurate, 7.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-269}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-167}:\\ \;\;\;\;-y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (if (<= x -3.1e-269) x (if (<= x 3.5e-167) (- (* y (/ z t))) x)))
                      double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (x <= -3.1e-269) {
                      		tmp = x;
                      	} else if (x <= 3.5e-167) {
                      		tmp = -(y * (z / t));
                      	} else {
                      		tmp = x;
                      	}
                      	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 (x <= (-3.1d-269)) then
                              tmp = x
                          else if (x <= 3.5d-167) then
                              tmp = -(y * (z / t))
                          else
                              tmp = x
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (x <= -3.1e-269) {
                      		tmp = x;
                      	} else if (x <= 3.5e-167) {
                      		tmp = -(y * (z / t));
                      	} else {
                      		tmp = x;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t):
                      	tmp = 0
                      	if x <= -3.1e-269:
                      		tmp = x
                      	elif x <= 3.5e-167:
                      		tmp = -(y * (z / t))
                      	else:
                      		tmp = x
                      	return tmp
                      
                      function code(x, y, z, t)
                      	tmp = 0.0
                      	if (x <= -3.1e-269)
                      		tmp = x;
                      	elseif (x <= 3.5e-167)
                      		tmp = Float64(-Float64(y * Float64(z / t)));
                      	else
                      		tmp = x;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	tmp = 0.0;
                      	if (x <= -3.1e-269)
                      		tmp = x;
                      	elseif (x <= 3.5e-167)
                      		tmp = -(y * (z / t));
                      	else
                      		tmp = x;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_] := If[LessEqual[x, -3.1e-269], x, If[LessEqual[x, 3.5e-167], (-N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), x]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;x \leq -3.1 \cdot 10^{-269}:\\
                      \;\;\;\;x\\
                      
                      \mathbf{elif}\;x \leq 3.5 \cdot 10^{-167}:\\
                      \;\;\;\;-y \cdot \frac{z}{t}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if x < -3.09999999999999967e-269 or 3.4999999999999999e-167 < x

                        1. Initial program 67.4%

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

                          \[\leadsto \color{blue}{x} \]
                        4. Step-by-step derivation
                          1. Simplified77.4%

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

                          if -3.09999999999999967e-269 < x < 3.4999999999999999e-167

                          1. Initial program 17.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{\color{blue}{z \cdot \left(y + z \cdot \left(\frac{1}{6} \cdot \left(z \cdot \left(y + \left(-3 \cdot {y}^{2} + 2 \cdot {y}^{3}\right)\right)\right) + \frac{1}{2} \cdot \left(y + -1 \cdot {y}^{2}\right)\right)\right)}}{t} \]
                          4. Step-by-step derivation
                            1. *-lowering-*.f64N/A

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

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

                              \[\leadsto x - \frac{z \cdot \color{blue}{\mathsf{fma}\left(z, \frac{1}{6} \cdot \left(z \cdot \left(y + \left(-3 \cdot {y}^{2} + 2 \cdot {y}^{3}\right)\right)\right) + \frac{1}{2} \cdot \left(y + -1 \cdot {y}^{2}\right), y\right)}}{t} \]
                          5. Simplified45.7%

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

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

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

                              \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
                            3. Step-by-step derivation
                              1. associate-*l/N/A

                                \[\leadsto -1 \cdot \color{blue}{\left(\frac{y}{t} \cdot z\right)} \]
                              2. associate-*l*N/A

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

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

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

                                \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{y}{t}\right)\right)} \]
                              6. distribute-neg-frac2N/A

                                \[\leadsto z \cdot \color{blue}{\frac{y}{\mathsf{neg}\left(t\right)}} \]
                              7. /-lowering-/.f64N/A

                                \[\leadsto z \cdot \color{blue}{\frac{y}{\mathsf{neg}\left(t\right)}} \]
                              8. neg-lowering-neg.f6449.7

                                \[\leadsto z \cdot \frac{y}{\color{blue}{-t}} \]
                            4. Simplified49.7%

                              \[\leadsto \color{blue}{z \cdot \frac{y}{-t}} \]
                            5. Step-by-step derivation
                              1. associate-*r/N/A

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

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

                                \[\leadsto \color{blue}{y \cdot \frac{z}{\mathsf{neg}\left(t\right)}} \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \color{blue}{y \cdot \frac{z}{\mathsf{neg}\left(t\right)}} \]
                              5. /-lowering-/.f64N/A

                                \[\leadsto y \cdot \color{blue}{\frac{z}{\mathsf{neg}\left(t\right)}} \]
                              6. neg-lowering-neg.f6450.8

                                \[\leadsto y \cdot \frac{z}{\color{blue}{-t}} \]
                            6. Applied egg-rr50.8%

                              \[\leadsto \color{blue}{y \cdot \frac{z}{-t}} \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification74.0%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-269}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-167}:\\ \;\;\;\;-y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 13: 81.3% accurate, 8.7× speedup?

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

                            1. Initial program 77.6%

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

                              \[\leadsto \color{blue}{x} \]
                            4. Step-by-step derivation
                              1. Simplified61.1%

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

                              if -1.65e-69 < z

                              1. Initial program 48.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 \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. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(y, \color{blue}{\mathsf{neg}\left(\frac{z}{t}\right)}, x\right) \]
                                3. /-lowering-/.f6491.7

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

                                \[\leadsto \mathsf{fma}\left(y, \color{blue}{-\frac{z}{t}}, x\right) \]
                            5. Recombined 2 regimes into one program.
                            6. Add Preprocessing

                            Alternative 14: 80.5% accurate, 8.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.62 \cdot 10^{-69}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot z}{t}\\ \end{array} \end{array} \]
                            (FPCore (x y z t)
                             :precision binary64
                             (if (<= z -1.62e-69) x (- x (/ (* y z) t))))
                            double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (z <= -1.62e-69) {
                            		tmp = x;
                            	} else {
                            		tmp = x - ((y * z) / 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) :: tmp
                                if (z <= (-1.62d-69)) then
                                    tmp = x
                                else
                                    tmp = x - ((y * z) / t)
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (z <= -1.62e-69) {
                            		tmp = x;
                            	} else {
                            		tmp = x - ((y * z) / t);
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t):
                            	tmp = 0
                            	if z <= -1.62e-69:
                            		tmp = x
                            	else:
                            		tmp = x - ((y * z) / t)
                            	return tmp
                            
                            function code(x, y, z, t)
                            	tmp = 0.0
                            	if (z <= -1.62e-69)
                            		tmp = x;
                            	else
                            		tmp = Float64(x - Float64(Float64(y * z) / t));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t)
                            	tmp = 0.0;
                            	if (z <= -1.62e-69)
                            		tmp = x;
                            	else
                            		tmp = x - ((y * z) / t);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_] := If[LessEqual[z, -1.62e-69], x, N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;z \leq -1.62 \cdot 10^{-69}:\\
                            \;\;\;\;x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;x - \frac{y \cdot z}{t}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if z < -1.62e-69

                              1. Initial program 77.6%

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

                                \[\leadsto \color{blue}{x} \]
                              4. Step-by-step derivation
                                1. Simplified61.1%

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

                                if -1.62e-69 < z

                                1. Initial program 48.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 x - \frac{\color{blue}{y \cdot z}}{t} \]
                                4. Step-by-step derivation
                                  1. *-lowering-*.f6491.4

                                    \[\leadsto x - \frac{\color{blue}{y \cdot z}}{t} \]
                                5. Simplified91.4%

                                  \[\leadsto x - \frac{\color{blue}{y \cdot z}}{t} \]
                              5. Recombined 2 regimes into one program.
                              6. Add Preprocessing

                              Alternative 15: 71.4% accurate, 226.0× speedup?

                              \[\begin{array}{l} \\ x \end{array} \]
                              (FPCore (x y z t) :precision binary64 x)
                              double code(double x, double y, double z, double t) {
                              	return x;
                              }
                              
                              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
                              end function
                              
                              public static double code(double x, double y, double z, double t) {
                              	return x;
                              }
                              
                              def code(x, y, z, t):
                              	return x
                              
                              function code(x, y, z, t)
                              	return x
                              end
                              
                              function tmp = code(x, y, z, t)
                              	tmp = x;
                              end
                              
                              code[x_, y_, z_, t_] := x
                              
                              \begin{array}{l}
                              
                              \\
                              x
                              \end{array}
                              
                              Derivation
                              1. Initial program 60.9%

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

                                \[\leadsto \color{blue}{x} \]
                              4. Step-by-step derivation
                                1. Simplified69.0%

                                  \[\leadsto \color{blue}{x} \]
                                2. Add Preprocessing

                                Developer Target 1: 74.3% 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 2024198 
                                (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)))