SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.2% → 98.0%
Time: 8.1s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
double code(double x, double y, double z, double t) {
	return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
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 + ((y * z) * (tanh((t / y)) - tanh((x / y))))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
def code(x, y, z, t):
	return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\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 10 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: 93.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
double code(double x, double y, double z, double t) {
	return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
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 + ((y * z) * (tanh((t / y)) - tanh((x / y))))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
def code(x, y, z, t):
	return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\end{array}

Alternative 1: 98.0% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)
\end{array}
Derivation
  1. Initial program 94.8%

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)} \]
    8. lower-*.f6498.1

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

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

Alternative 2: 76.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;t \leq -42000000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{t \cdot t}{x + t}, z, x\right)\\

\mathbf{elif}\;t \leq 3.8 \cdot 10^{-41}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right), z \cdot y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.5e44 or 3.79999999999999979e-41 < t

    1. Initial program 97.8%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)} \]
      8. lower-*.f64100.0

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

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

      \[\leadsto \mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \cdot y, z, x\right) \]
    6. Step-by-step derivation
      1. lower-/.f6466.8

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

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

    if -4.5e44 < t < -4.2e13

    1. Initial program 91.3%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
      4. lower--.f6455.9

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
    5. Applied rewrites55.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites30.2%

        \[\leadsto \mathsf{fma}\left(\frac{\left(x + t\right) \cdot \left(t - x\right)}{x + t}, z, x\right) \]
      2. Taylor expanded in x around 0

        \[\leadsto \mathsf{fma}\left(\frac{{t}^{2}}{x + t}, z, x\right) \]
      3. Step-by-step derivation
        1. Applied rewrites91.1%

          \[\leadsto \mathsf{fma}\left(\frac{t \cdot t}{x + t}, z, x\right) \]

        if -4.2e13 < t < 3.79999999999999979e-41

        1. Initial program 91.8%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)} \]
          8. lower-*.f6495.9

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \color{blue}{\frac{\frac{-1}{2} \cdot \left(-1 \cdot {t}^{2} + {t}^{2}\right)}{y}}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          5. distribute-lft1-inN/A

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\frac{-1}{2} \cdot \left(\color{blue}{0} \cdot {t}^{2}\right)}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          7. mul0-lftN/A

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\color{blue}{0}}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          9. mul0-lftN/A

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\color{blue}{0 \cdot {x}^{2}}}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\color{blue}{\left(-1 + 1\right)} \cdot {x}^{2}}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          11. distribute-lft1-inN/A

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

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \color{blue}{\frac{-1 \cdot {x}^{2} + {x}^{2}}{y}}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          14. distribute-lft1-inN/A

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\color{blue}{0} \cdot {x}^{2}}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          16. mul0-lft91.8

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{\mathsf{Rewrite=>}\left(--rgt-identity, t\right)}{y} - \tanh \left(\frac{x}{y}\right), \color{blue}{z \cdot y}, x\right) \]
          6. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{\mathsf{Rewrite=>}\left(--rgt-identity, t\right)}{y} - \tanh \left(\frac{x}{y}\right), \color{blue}{z \cdot y}, x\right) \]
        9. Applied rewrites87.7%

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

      Alternative 3: 78.7% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{+35} \lor \neg \left(t \leq 4 \cdot 10^{-41}\right):\\ \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot y, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (or (<= t -4.2e+35) (not (<= t 4e-41)))
         (fma (* (- (tanh (/ t y)) (/ x y)) y) z x)
         (fma (* (- (/ t y) (tanh (/ x y))) y) z x)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((t <= -4.2e+35) || !(t <= 4e-41)) {
      		tmp = fma(((tanh((t / y)) - (x / y)) * y), z, x);
      	} else {
      		tmp = fma((((t / y) - tanh((x / y))) * y), z, x);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if ((t <= -4.2e+35) || !(t <= 4e-41))
      		tmp = fma(Float64(Float64(tanh(Float64(t / y)) - Float64(x / y)) * y), z, x);
      	else
      		tmp = fma(Float64(Float64(Float64(t / y) - tanh(Float64(x / y))) * y), z, x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.2e+35], N[Not[LessEqual[t, 4e-41]], $MachinePrecision]], N[(N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[(x / y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] * z + x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -4.2 \cdot 10^{+35} \lor \neg \left(t \leq 4 \cdot 10^{-41}\right):\\
      \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot y, z, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -4.1999999999999998e35 or 4.00000000000000002e-41 < t

        1. Initial program 97.8%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)} \]
          8. lower-*.f64100.0

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

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

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

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

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

        if -4.1999999999999998e35 < t < 4.00000000000000002e-41

        1. Initial program 91.5%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)} \]
          8. lower-*.f6496.1

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \color{blue}{\frac{\frac{-1}{2} \cdot \left(-1 \cdot {t}^{2} + {t}^{2}\right)}{y}}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          5. distribute-lft1-inN/A

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\frac{-1}{2} \cdot \left(\color{blue}{0} \cdot {t}^{2}\right)}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          7. mul0-lftN/A

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\color{blue}{0}}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          9. mul0-lftN/A

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\color{blue}{0 \cdot {x}^{2}}}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\color{blue}{\left(-1 + 1\right)} \cdot {x}^{2}}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          11. distribute-lft1-inN/A

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

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \color{blue}{\frac{-1 \cdot {x}^{2} + {x}^{2}}{y}}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          14. distribute-lft1-inN/A

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{t - \frac{\color{blue}{0} \cdot {x}^{2}}{y}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
          16. mul0-lft90.7

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

          \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t - \frac{0}{y}}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      3. Recombined 2 regimes into one program.
      4. Final simplification77.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{+35} \lor \neg \left(t \leq 4 \cdot 10^{-41}\right):\\ \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot y, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 4: 73.0% accurate, 1.6× speedup?

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

        1. Initial program 100.0%

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
          4. lower--.f6448.7

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites13.9%

            \[\leadsto \mathsf{fma}\left(\frac{\left(x + t\right) \cdot \left(t - x\right)}{x + t}, z, x\right) \]
          2. Taylor expanded in x around 0

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

              \[\leadsto \mathsf{fma}\left(\frac{t \cdot t}{x + t}, z, x\right) \]

            if -1.0500000000000001e140 < x < 4.99999999999999962e125

            1. Initial program 92.7%

              \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)} \]
              8. lower-*.f6497.4

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

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

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

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

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

            if 4.99999999999999962e125 < x

            1. Initial program 100.0%

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
              4. lower--.f6455.8

                \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
            5. Applied rewrites55.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
            6. Step-by-step derivation
              1. Applied rewrites14.6%

                \[\leadsto \mathsf{fma}\left(\frac{\left(x + t\right) \cdot \left(t - x\right)}{x + t}, z, x\right) \]
              2. Taylor expanded in x around 0

                \[\leadsto \mathsf{fma}\left(\frac{{t}^{2}}{x + t}, z, x\right) \]
              3. Step-by-step derivation
                1. Applied rewrites62.8%

                  \[\leadsto \mathsf{fma}\left(\frac{t \cdot t}{x + t}, z, x\right) \]
                2. Step-by-step derivation
                  1. Applied rewrites65.2%

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

                Alternative 5: 60.9% accurate, 5.8× speedup?

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

                  1. Initial program 93.5%

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                    4. lower--.f6433.9

                      \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                  5. Applied rewrites33.9%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                  6. Step-by-step derivation
                    1. Applied rewrites28.8%

                      \[\leadsto \mathsf{fma}\left(\frac{\left(x + t\right) \cdot \left(t - x\right)}{x + t}, z, x\right) \]
                    2. Taylor expanded in x around 0

                      \[\leadsto \mathsf{fma}\left(\frac{{t}^{2}}{x + t}, z, x\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites38.0%

                        \[\leadsto \mathsf{fma}\left(\frac{t \cdot t}{x + t}, z, x\right) \]

                      if -1.91999999999999998e28 < z < 1.12e-144

                      1. Initial program 99.1%

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                        4. lower--.f6475.8

                          \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                      5. Applied rewrites75.8%

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

                        \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites90.3%

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

                        if 1.12e-144 < z < 5.80000000000000034e78

                        1. Initial program 99.8%

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

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

                            \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                          2. lower--.f6443.6

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

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

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

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

                            \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \frac{t - x}{y}} + x \]
                          4. lower-fma.f6443.6

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

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

                            \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y}, \frac{t - x}{y}, x\right) \]
                          7. lower-*.f6443.6

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

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

                          \[\leadsto \mathsf{fma}\left(z \cdot y, \frac{t}{\color{blue}{y}}, x\right) \]
                        9. Step-by-step derivation
                          1. Applied rewrites60.9%

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

                          if 5.80000000000000034e78 < z

                          1. Initial program 84.0%

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                            4. lower--.f6442.9

                              \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                          5. Applied rewrites42.9%

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

                        Alternative 6: 62.9% accurate, 5.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(t - x, z, x\right)\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{-12}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-144}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+78}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y, \frac{t}{y}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (let* ((t_1 (fma (- t x) z x)))
                           (if (<= z -1.75e-12)
                             t_1
                             (if (<= z 1.12e-144)
                               (fma (- x) z x)
                               (if (<= z 5.8e+78) (fma (* z y) (/ t y) x) t_1)))))
                        double code(double x, double y, double z, double t) {
                        	double t_1 = fma((t - x), z, x);
                        	double tmp;
                        	if (z <= -1.75e-12) {
                        		tmp = t_1;
                        	} else if (z <= 1.12e-144) {
                        		tmp = fma(-x, z, x);
                        	} else if (z <= 5.8e+78) {
                        		tmp = fma((z * y), (t / y), x);
                        	} else {
                        		tmp = t_1;
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y, z, t)
                        	t_1 = fma(Float64(t - x), z, x)
                        	tmp = 0.0
                        	if (z <= -1.75e-12)
                        		tmp = t_1;
                        	elseif (z <= 1.12e-144)
                        		tmp = fma(Float64(-x), z, x);
                        	elseif (z <= 5.8e+78)
                        		tmp = fma(Float64(z * y), Float64(t / y), x);
                        	else
                        		tmp = t_1;
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[z, -1.75e-12], t$95$1, If[LessEqual[z, 1.12e-144], N[((-x) * z + x), $MachinePrecision], If[LessEqual[z, 5.8e+78], N[(N[(z * y), $MachinePrecision] * N[(t / y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_1 := \mathsf{fma}\left(t - x, z, x\right)\\
                        \mathbf{if}\;z \leq -1.75 \cdot 10^{-12}:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;z \leq 1.12 \cdot 10^{-144}:\\
                        \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\
                        
                        \mathbf{elif}\;z \leq 5.8 \cdot 10^{+78}:\\
                        \;\;\;\;\mathsf{fma}\left(z \cdot y, \frac{t}{y}, x\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if z < -1.75e-12 or 5.80000000000000034e78 < z

                          1. Initial program 88.7%

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                            4. lower--.f6439.9

                              \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                          5. Applied rewrites39.9%

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

                          if -1.75e-12 < z < 1.12e-144

                          1. Initial program 100.0%

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                            4. lower--.f6475.6

                              \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                          5. Applied rewrites75.6%

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

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

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

                            if 1.12e-144 < z < 5.80000000000000034e78

                            1. Initial program 99.8%

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

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

                                \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                              2. lower--.f6443.6

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

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

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

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

                                \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \frac{t - x}{y}} + x \]
                              4. lower-fma.f6443.6

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

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

                                \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot y}, \frac{t - x}{y}, x\right) \]
                              7. lower-*.f6443.6

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

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

                              \[\leadsto \mathsf{fma}\left(z \cdot y, \frac{t}{\color{blue}{y}}, x\right) \]
                            9. Step-by-step derivation
                              1. Applied rewrites60.9%

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

                            Alternative 7: 62.7% accurate, 10.8× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{-12} \lor \neg \left(z \leq 4 \cdot 10^{-146}\right):\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \end{array} \end{array} \]
                            (FPCore (x y z t)
                             :precision binary64
                             (if (or (<= z -1.75e-12) (not (<= z 4e-146)))
                               (fma (- t x) z x)
                               (fma (- x) z x)))
                            double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if ((z <= -1.75e-12) || !(z <= 4e-146)) {
                            		tmp = fma((t - x), z, x);
                            	} else {
                            		tmp = fma(-x, z, x);
                            	}
                            	return tmp;
                            }
                            
                            function code(x, y, z, t)
                            	tmp = 0.0
                            	if ((z <= -1.75e-12) || !(z <= 4e-146))
                            		tmp = fma(Float64(t - x), z, x);
                            	else
                            		tmp = fma(Float64(-x), z, x);
                            	end
                            	return tmp
                            end
                            
                            code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.75e-12], N[Not[LessEqual[z, 4e-146]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision], N[((-x) * z + x), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;z \leq -1.75 \cdot 10^{-12} \lor \neg \left(z \leq 4 \cdot 10^{-146}\right):\\
                            \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if z < -1.75e-12 or 4.0000000000000001e-146 < z

                              1. Initial program 91.5%

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

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

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

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

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                4. lower--.f6442.2

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

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

                              if -1.75e-12 < z < 4.0000000000000001e-146

                              1. Initial program 100.0%

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

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

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

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

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                4. lower--.f6475.6

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                              5. Applied rewrites75.6%

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

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

                                  \[\leadsto \mathsf{fma}\left(-x, z, x\right) \]
                              8. Recombined 2 regimes into one program.
                              9. Final simplification61.5%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{-12} \lor \neg \left(z \leq 4 \cdot 10^{-146}\right):\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 8: 62.6% accurate, 11.4× speedup?

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

                                1. Initial program 90.2%

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

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

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

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                  4. lower--.f6437.6

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                5. Applied rewrites37.6%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites32.5%

                                    \[\leadsto \mathsf{fma}\left(\frac{\left(x + t\right) \cdot \left(t - x\right)}{x + t}, z, x\right) \]
                                  2. Taylor expanded in x around inf

                                    \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites19.5%

                                      \[\leadsto \mathsf{fma}\left(-x, z, x\right) \]
                                    2. Taylor expanded in z around inf

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

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

                                      if -3.3e-10 < z < 5.79999999999999962e-10

                                      1. Initial program 99.9%

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

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

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

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

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                        4. lower--.f6475.0

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

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

                                        \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites87.4%

                                          \[\leadsto \mathsf{fma}\left(-x, z, x\right) \]
                                      8. Recombined 2 regimes into one program.
                                      9. Final simplification60.4%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{-10} \lor \neg \left(z \leq 5.8 \cdot 10^{-10}\right):\\ \;\;\;\;\left(t - x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \end{array} \]
                                      10. Add Preprocessing

                                      Alternative 9: 26.6% accurate, 26.6× speedup?

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

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites39.6%

                                          \[\leadsto \mathsf{fma}\left(\frac{\left(x + t\right) \cdot \left(t - x\right)}{x + t}, z, x\right) \]
                                        2. Taylor expanded in x around inf

                                          \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites51.1%

                                            \[\leadsto \mathsf{fma}\left(-x, z, x\right) \]
                                          2. Taylor expanded in z around inf

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

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

                                              \[\leadsto \left(t - x\right) \cdot z \]
                                            3. Add Preprocessing

                                            Alternative 10: 16.8% accurate, 39.8× speedup?

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

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

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

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

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

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

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

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

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

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

                                              Developer Target 1: 97.3% accurate, 1.0× speedup?

                                              \[\begin{array}{l} \\ x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \end{array} \]
                                              (FPCore (x y z t)
                                               :precision binary64
                                               (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y)))))))
                                              double code(double x, double y, double z, double t) {
                                              	return x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
                                              }
                                              
                                              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 + (y * (z * (tanh((t / y)) - tanh((x / y)))))
                                              end function
                                              
                                              public static double code(double x, double y, double z, double t) {
                                              	return x + (y * (z * (Math.tanh((t / y)) - Math.tanh((x / y)))));
                                              }
                                              
                                              def code(x, y, z, t):
                                              	return x + (y * (z * (math.tanh((t / y)) - math.tanh((x / y)))))
                                              
                                              function code(x, y, z, t)
                                              	return Float64(x + Float64(y * Float64(z * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))))))
                                              end
                                              
                                              function tmp = code(x, y, z, t)
                                              	tmp = x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
                                              end
                                              
                                              code[x_, y_, z_, t_] := N[(x + N[(y * N[(z * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)
                                              \end{array}
                                              

                                              Reproduce

                                              ?
                                              herbie shell --seed 2024363 
                                              (FPCore (x y z t)
                                                :name "SynthBasics:moogVCF from YampaSynth-0.2"
                                                :precision binary64
                                              
                                                :alt
                                                (! :herbie-platform default (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y)))))))
                                              
                                                (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))