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

Percentage Accurate: 62.2% → 94.1%
Time: 7.9s
Alternatives: 12
Speedup: 31.2×

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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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}

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 12 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: 62.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
	return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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: 94.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x - \frac{\log \left(\mathsf{fma}\left(\mathsf{expm1}\left(z\right), y, 1\right)\right)}{t}\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.5000000000000004e43 or 3.3499999999999998e127 < y

    1. Initial program 36.2%

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

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

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

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

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

        \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{expm1}\left(z\right), y, 1\right)\right)}{t} \]
    4. Applied rewrites86.6%

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

    if -9.5000000000000004e43 < y < 3.3499999999999998e127

    1. Initial program 72.5%

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

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

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

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

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

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

Alternative 2: 94.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x - \frac{\log \left(\mathsf{fma}\left(\mathsf{expm1}\left(z\right), y, 1\right)\right)}{t}\\
\mathbf{if}\;y \leq -95:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 3.35 \cdot 10^{+127}:\\
\;\;\;\;x - \left(-y\right) \cdot \frac{\mathsf{expm1}\left(z\right)}{-t}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -95 or 3.3499999999999998e127 < y

    1. Initial program 38.3%

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

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

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

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

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

        \[\leadsto x - \frac{\log \left(\mathsf{fma}\left(\mathsf{expm1}\left(z\right), y, 1\right)\right)}{t} \]
    4. Applied rewrites85.8%

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

    if -95 < y < 3.3499999999999998e127

    1. Initial program 73.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\left(1 - e^{z}\right)\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      6. sub-negate-revN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      9. lower-neg.f6498.2

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right) \]
    4. Applied rewrites98.2%

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

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

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

        \[\leadsto \frac{e^{z} - 1}{-t} \cdot y + x \]
      4. lift-neg.f64N/A

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

        \[\leadsto y \cdot \frac{e^{z} - 1}{\mathsf{neg}\left(t\right)} + x \]
      6. distribute-frac-neg2N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) + x \]
      7. sub-divN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) + x \]
      8. sub-negate-revN/A

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

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

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

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

        \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) \]
      13. sub-divN/A

        \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) \]
      14. distribute-frac-neg2N/A

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

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

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

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

        \[\leadsto x - \left(-y\right) \cdot \frac{\mathsf{expm1}\left(z\right)}{-t} \]
      19. lift-/.f6498.2

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

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

Alternative 3: 93.0% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 57.3%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\left(1 - e^{z}\right)\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      6. sub-negate-revN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      9. lower-neg.f6493.0

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right) \]
    4. Applied rewrites93.0%

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

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

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

        \[\leadsto \frac{e^{z} - 1}{-t} \cdot y + x \]
      4. lift-neg.f64N/A

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

        \[\leadsto y \cdot \frac{e^{z} - 1}{\mathsf{neg}\left(t\right)} + x \]
      6. distribute-frac-neg2N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) + x \]
      7. sub-divN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) + x \]
      8. sub-negate-revN/A

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

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

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

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

        \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) \]
      13. sub-divN/A

        \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) \]
      14. distribute-frac-neg2N/A

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

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

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

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

        \[\leadsto x - \left(-y\right) \cdot \frac{\mathsf{expm1}\left(z\right)}{-t} \]
      19. lift-/.f6493.0

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

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

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

    1. Initial program 94.7%

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

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

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

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

        \[\leadsto x - \frac{\log \left(\mathsf{expm1}\left(z\right) \cdot y\right)}{t} \]
    4. Applied rewrites93.0%

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

Alternative 4: 88.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \log \left(\mathsf{fma}\left(z, y, 1\right)\right)\\
\mathbf{if}\;y \leq -7 \cdot 10^{+84}:\\
\;\;\;\;x - t\_1 \cdot \frac{1}{t}\\

\mathbf{elif}\;y \leq 3.35 \cdot 10^{+127}:\\
\;\;\;\;x - \left(-y\right) \cdot \frac{\mathsf{expm1}\left(z\right)}{-t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.9999999999999998e84

    1. Initial program 49.2%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\log \left(\mathsf{fma}\left(z, y, 1\right)\right) \cdot \frac{1}{t}} \]
      4. lower-/.f6455.0

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

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

    if -6.9999999999999998e84 < y < 3.3499999999999998e127

    1. Initial program 70.7%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\left(1 - e^{z}\right)\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      6. sub-negate-revN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      9. lower-neg.f6496.2

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right) \]
    4. Applied rewrites96.2%

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

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

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

        \[\leadsto \frac{e^{z} - 1}{-t} \cdot y + x \]
      4. lift-neg.f64N/A

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

        \[\leadsto y \cdot \frac{e^{z} - 1}{\mathsf{neg}\left(t\right)} + x \]
      6. distribute-frac-neg2N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) + x \]
      7. sub-divN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) + x \]
      8. sub-negate-revN/A

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

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

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

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

        \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) \]
      13. sub-divN/A

        \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) \]
      14. distribute-frac-neg2N/A

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

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

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

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

        \[\leadsto x - \left(-y\right) \cdot \frac{\mathsf{expm1}\left(z\right)}{-t} \]
      19. lift-/.f6496.2

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

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

    if 3.3499999999999998e127 < y

    1. Initial program 7.5%

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

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

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

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

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

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

Alternative 5: 88.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := x - \frac{\log \left(\mathsf{fma}\left(z, y, 1\right)\right)}{t}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 3.35 \cdot 10^{+127}:\\
\;\;\;\;x - \left(-y\right) \cdot \frac{\mathsf{expm1}\left(z\right)}{-t}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.9999999999999998e84 or 3.3499999999999998e127 < y

    1. Initial program 35.8%

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

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

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

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

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

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

    if -6.9999999999999998e84 < y < 3.3499999999999998e127

    1. Initial program 70.7%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\left(1 - e^{z}\right)\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      6. sub-negate-revN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      9. lower-neg.f6496.2

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right) \]
    4. Applied rewrites96.2%

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

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

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

        \[\leadsto \frac{e^{z} - 1}{-t} \cdot y + x \]
      4. lift-neg.f64N/A

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

        \[\leadsto y \cdot \frac{e^{z} - 1}{\mathsf{neg}\left(t\right)} + x \]
      6. distribute-frac-neg2N/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) + x \]
      7. sub-divN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) + x \]
      8. sub-negate-revN/A

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

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

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

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

        \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) \]
      13. sub-divN/A

        \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) \]
      14. distribute-frac-neg2N/A

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

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

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

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

        \[\leadsto x - \left(-y\right) \cdot \frac{\mathsf{expm1}\left(z\right)}{-t} \]
      19. lift-/.f6496.2

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

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

Alternative 6: 88.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := x - \frac{\log \left(\mathsf{fma}\left(z, y, 1\right)\right)}{t}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.9999999999999998e84 or 3.3499999999999998e127 < y

    1. Initial program 35.8%

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

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

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

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

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

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

    if -6.9999999999999998e84 < y < 3.3499999999999998e127

    1. Initial program 70.7%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\left(1 - e^{z}\right)\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      6. sub-negate-revN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      9. lower-neg.f6496.2

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right) \]
    4. Applied rewrites96.2%

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

Alternative 7: 86.7% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{+166}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\log \left(z \cdot y\right)}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.99999999999999952e166

    1. Initial program 65.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\left(1 - e^{z}\right)\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
      6. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right) \]
    4. Applied rewrites87.8%

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

    if 7.99999999999999952e166 < y

    1. Initial program 7.5%

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\log \left(z \cdot y\right)}{t} \]
      2. lower-*.f6471.2

        \[\leadsto x - \frac{\log \left(z \cdot y\right)}{t} \]
    7. Applied rewrites71.2%

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

Alternative 8: 85.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{+166}:\\
\;\;\;\;x - \frac{\mathsf{expm1}\left(z\right) \cdot y}{t}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\log \left(z \cdot y\right)}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.99999999999999952e166

    1. Initial program 65.8%

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

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

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

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

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

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

    if 7.99999999999999952e166 < y

    1. Initial program 7.5%

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\log \left(z \cdot y\right)}{t} \]
      2. lower-*.f6471.2

        \[\leadsto x - \frac{\log \left(z \cdot y\right)}{t} \]
    7. Applied rewrites71.2%

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

Alternative 9: 81.6% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.000225:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{-t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -0.000225) x (+ x (* y (/ z (- t))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -0.000225) {
		tmp = x;
	} else {
		tmp = x + (y * (z / -t));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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 <= (-0.000225d0)) 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 <= -0.000225) {
		tmp = x;
	} else {
		tmp = x + (y * (z / -t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -0.000225:
		tmp = x
	else:
		tmp = x + (y * (z / -t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -0.000225)
		tmp = x;
	else
		tmp = Float64(x + Float64(y * Float64(z / Float64(-t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -0.000225)
		tmp = x;
	else
		tmp = x + (y * (z / -t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.000225], x, N[(x + N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.000225:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{-t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2499999999999999e-4

    1. Initial program 82.0%

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

      \[\leadsto \color{blue}{x} \]
    3. Step-by-step derivation
      1. Applied rewrites63.1%

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

      if -2.2499999999999999e-4 < z

      1. Initial program 53.6%

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\left(1 - e^{z}\right)\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
        6. sub-negate-revN/A

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

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

          \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
        9. lower-neg.f6489.7

          \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right) \]
      4. Applied rewrites89.7%

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

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

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

          \[\leadsto \frac{e^{z} - 1}{-t} \cdot y + x \]
        4. lift-neg.f64N/A

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

          \[\leadsto y \cdot \frac{e^{z} - 1}{\mathsf{neg}\left(t\right)} + x \]
        6. distribute-frac-neg2N/A

          \[\leadsto y \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) + x \]
        7. sub-divN/A

          \[\leadsto y \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) + x \]
        8. sub-negate-revN/A

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

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

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

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

          \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\left(\frac{e^{z}}{t} - \frac{1}{t}\right)\right)\right) \]
        13. sub-divN/A

          \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \left(\mathsf{neg}\left(\frac{e^{z} - 1}{t}\right)\right) \]
        14. distribute-frac-neg2N/A

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

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

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

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

          \[\leadsto x - \left(-y\right) \cdot \frac{\mathsf{expm1}\left(z\right)}{-t} \]
        19. lift-/.f6489.7

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

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

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

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

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

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

            \[\leadsto x - \left(\mathsf{neg}\left(y\right)\right) \cdot \frac{\color{blue}{z}}{-t} \]
          4. fp-cancel-sign-subN/A

            \[\leadsto x + \color{blue}{y \cdot \frac{z}{-t}} \]
          5. lower-+.f64N/A

            \[\leadsto x + \color{blue}{y \cdot \frac{z}{-t}} \]
          6. lower-*.f6489.7

            \[\leadsto x + y \cdot \color{blue}{\frac{z}{-t}} \]
        3. Applied rewrites89.7%

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

      Alternative 10: 81.6% accurate, 2.2× speedup?

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

        1. Initial program 82.0%

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

          \[\leadsto \color{blue}{x} \]
        3. Step-by-step derivation
          1. Applied rewrites63.1%

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

          if -2.2499999999999999e-4 < z

          1. Initial program 53.6%

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\left(1 - e^{z}\right)\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
            6. sub-negate-revN/A

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

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

              \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{\mathsf{neg}\left(t\right)}, y, x\right) \]
            9. lower-neg.f6489.7

              \[\leadsto \mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{-t}, y, x\right) \]
          4. Applied rewrites89.7%

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

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

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

          Alternative 11: 80.8% accurate, 2.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.000225:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot y}{t}\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= z -0.000225) x (- x (/ (* z y) t))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (z <= -0.000225) {
          		tmp = x;
          	} else {
          		tmp = x - ((z * y) / t);
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t)
          use fmin_fmax_functions
              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 <= (-0.000225d0)) then
                  tmp = x
              else
                  tmp = x - ((z * y) / t)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if (z <= -0.000225) {
          		tmp = x;
          	} else {
          		tmp = x - ((z * y) / t);
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if z <= -0.000225:
          		tmp = x
          	else:
          		tmp = x - ((z * y) / t)
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (z <= -0.000225)
          		tmp = x;
          	else
          		tmp = Float64(x - Float64(Float64(z * y) / t));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if (z <= -0.000225)
          		tmp = x;
          	else
          		tmp = x - ((z * y) / t);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[z, -0.000225], x, N[(x - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -0.000225:\\
          \;\;\;\;x\\
          
          \mathbf{else}:\\
          \;\;\;\;x - \frac{z \cdot y}{t}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -2.2499999999999999e-4

            1. Initial program 82.0%

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

              \[\leadsto \color{blue}{x} \]
            3. Step-by-step derivation
              1. Applied rewrites63.1%

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

              if -2.2499999999999999e-4 < z

              1. Initial program 53.6%

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

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

                  \[\leadsto x - \frac{z \cdot \color{blue}{y}}{t} \]
                2. lower-*.f6488.4

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

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

            Alternative 12: 71.1% accurate, 31.2× 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;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y, z, t)
            use fmin_fmax_functions
                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 62.2%

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

              \[\leadsto \color{blue}{x} \]
            3. Step-by-step derivation
              1. Applied rewrites71.1%

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

              Reproduce

              ?
              herbie shell --seed 2025128 
              (FPCore (x y z t)
                :name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
                :precision binary64
                (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))