SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.6% → 97.9%
Time: 10.3s
Alternatives: 12
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))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((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 12 alternatives:

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

Initial Program: 93.6% 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))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((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: 97.9% 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 93.4%

    \[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.2

      \[\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.2%

    \[\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: 64.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot z\\ t_2 := \left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x\\ t_3 := z \cdot t + x\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+17}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-160}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+307}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- t x) z))
        (t_2 (+ (* (* z y) (- (tanh (/ t y)) (tanh (/ x y)))) x))
        (t_3 (+ (* z t) x)))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -5e+17)
       t_3
       (if (<= t_2 4e-160) (fma (- x) z x) (if (<= t_2 1e+307) t_3 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (t - x) * z;
	double t_2 = ((z * y) * (tanh((t / y)) - tanh((x / y)))) + x;
	double t_3 = (z * t) + x;
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -5e+17) {
		tmp = t_3;
	} else if (t_2 <= 4e-160) {
		tmp = fma(-x, z, x);
	} else if (t_2 <= 1e+307) {
		tmp = t_3;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(t - x) * z)
	t_2 = Float64(Float64(Float64(z * y) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))) + x)
	t_3 = Float64(Float64(z * t) + x)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -5e+17)
		tmp = t_3;
	elseif (t_2 <= 4e-160)
		tmp = fma(Float64(-x), z, x);
	elseif (t_2 <= 1e+307)
		tmp = t_3;
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * y), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e+17], t$95$3, If[LessEqual[t$95$2, 4e-160], N[((-x) * z + x), $MachinePrecision], If[LessEqual[t$95$2, 1e+307], t$95$3, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot z\\
t_2 := \left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x\\
t_3 := z \cdot t + x\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+17}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-160}:\\
\;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\

\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -inf.0 or 9.99999999999999986e306 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))

    1. Initial program 59.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--.f64100.0

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

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

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

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

      if -inf.0 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -5e17 or 4e-160 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 9.99999999999999986e306

      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 x + \color{blue}{z \cdot \left(t - x\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
        3. lower--.f6454.4

          \[\leadsto x + \color{blue}{\left(t - x\right)} \cdot z \]
      5. Applied rewrites54.4%

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

        \[\leadsto x + t \cdot \color{blue}{z} \]
      7. Step-by-step derivation
        1. Applied rewrites64.3%

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

        if -5e17 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 4e-160

        1. Initial program 94.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.5

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \leq -\infty:\\ \;\;\;\;\left(t - x\right) \cdot z\\ \mathbf{elif}\;\left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \leq -5 \cdot 10^{+17}:\\ \;\;\;\;z \cdot t + x\\ \mathbf{elif}\;\left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \leq 4 \cdot 10^{-160}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{elif}\;\left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \leq 10^{+307}:\\ \;\;\;\;z \cdot t + x\\ \mathbf{else}:\\ \;\;\;\;\left(t - x\right) \cdot z\\ \end{array} \]
        10. Add Preprocessing

        Alternative 3: 59.0% accurate, 1.3× speedup?

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

          1. Initial program 95.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 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--.f6440.8

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

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

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

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

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

              if 1.8000000000000001e-57 < y < 3.85e14

              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--.f6439.2

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

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

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

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

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

                  if 3.85e14 < y

                  1. Initial program 85.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 x + \color{blue}{z \cdot \left(t - x\right)} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

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

                      \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                    3. lower--.f6483.8

                      \[\leadsto x + \color{blue}{\left(t - x\right)} \cdot z \]
                  5. Applied rewrites83.8%

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

                      \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{t}, z \cdot \left(-x\right)\right) \]
                  7. Recombined 3 regimes into one program.
                  8. Final simplification62.6%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-57}:\\ \;\;\;\;{\left(\frac{\frac{\mathsf{fma}\left(y, x, \frac{x \cdot y}{t} \cdot x\right)}{t} + y}{t}\right)}^{-1} \cdot \left(z \cdot y\right) + x\\ \mathbf{elif}\;y \leq 3.85 \cdot 10^{+14}:\\ \;\;\;\;{\left(\frac{\mathsf{fma}\left(\frac{x \cdot x}{t}, \frac{y}{t}, \mathsf{fma}\left(y, \frac{x}{t}, y\right)\right)}{t}\right)}^{-1} \cdot \left(z \cdot y\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \left(-x\right) \cdot z\right) + x\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 4: 60.9% accurate, 1.4× speedup?

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

                    1. Initial program 95.4%

                      \[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--.f6440.3

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

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

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

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

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

                        if 1.17999999999999999e-63 < y < 1e177

                        1. Initial program 92.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-*.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. Taylor expanded in t around 0

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

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

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

                        if 1e177 < y

                        1. Initial program 81.4%

                          \[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 + \color{blue}{z \cdot \left(t - x\right)} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

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

                            \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                          3. lower--.f6496.6

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

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

                            \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{t}, z \cdot \left(-x\right)\right) \]
                        7. Recombined 3 regimes into one program.
                        8. Final simplification63.0%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.18 \cdot 10^{-63}:\\ \;\;\;\;{\left(\frac{\frac{\mathsf{fma}\left(y, x, \frac{x \cdot y}{t} \cdot x\right)}{t} + y}{t}\right)}^{-1} \cdot \left(z \cdot y\right) + x\\ \mathbf{elif}\;y \leq 10^{+177}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \left(-x\right) \cdot z\right) + x\\ \end{array} \]
                        9. Add Preprocessing

                        Alternative 5: 59.3% accurate, 1.4× speedup?

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

                          1. Initial program 95.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 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--.f6440.7

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

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

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

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

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

                              if 6.60000000000000053e30 < y

                              1. Initial program 84.4%

                                \[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 + \color{blue}{z \cdot \left(t - x\right)} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

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

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

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

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

                                  \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{t}, z \cdot \left(-x\right)\right) \]
                              7. Recombined 2 regimes into one program.
                              8. Final simplification61.8%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.6 \cdot 10^{+30}:\\ \;\;\;\;{\left(\frac{\frac{\mathsf{fma}\left(y, x, \frac{x \cdot y}{t} \cdot x\right)}{t} + y}{t}\right)}^{-1} \cdot \left(z \cdot y\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \left(-x\right) \cdot z\right) + x\\ \end{array} \]
                              9. Add Preprocessing

                              Alternative 6: 77.3% accurate, 1.6× speedup?

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

                                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. 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 t around 0

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

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

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

                                if -7.60000000000000001e48 < x < 5.4000000000000002e173

                                1. Initial program 90.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-*.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(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \cdot y, z, x\right) \]
                                6. Step-by-step derivation
                                  1. lower-/.f6480.4

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

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

                                if 5.4000000000000002e173 < 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 x + \color{blue}{z \cdot \left(t - x\right)} \]
                                4. Step-by-step derivation
                                  1. *-commutativeN/A

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

                                    \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                                  3. lower--.f6461.0

                                    \[\leadsto x + \color{blue}{\left(t - x\right)} \cdot z \]
                                5. Applied rewrites61.0%

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

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

                                    \[\leadsto x + t \cdot \color{blue}{z} \]
                                8. Recombined 3 regimes into one program.
                                9. Final simplification80.9%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.6 \cdot 10^{+48}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)\\ \mathbf{elif}\;x \leq 5.4 \cdot 10^{+173}:\\ \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot y, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot t + x\\ \end{array} \]
                                10. Add Preprocessing

                                Alternative 7: 60.5% accurate, 10.4× speedup?

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

                                  1. Initial program 95.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 x + \color{blue}{z \cdot \left(t - x\right)} \]
                                  4. Step-by-step derivation
                                    1. *-commutativeN/A

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

                                      \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                                    3. lower--.f6452.6

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

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

                                    \[\leadsto x + t \cdot \color{blue}{z} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites59.0%

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

                                    if 2.55000000000000004e-80 < y

                                    1. Initial program 89.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 x + \color{blue}{z \cdot \left(t - x\right)} \]
                                    4. Step-by-step derivation
                                      1. *-commutativeN/A

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

                                        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                                      3. lower--.f6472.8

                                        \[\leadsto x + \color{blue}{\left(t - x\right)} \cdot z \]
                                    5. Applied rewrites72.8%

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

                                        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{t}, z \cdot \left(-x\right)\right) \]
                                    7. Recombined 2 regimes into one program.
                                    8. Final simplification63.4%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.55 \cdot 10^{-80}:\\ \;\;\;\;z \cdot t + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \left(-x\right) \cdot z\right) + x\\ \end{array} \]
                                    9. Add Preprocessing

                                    Alternative 8: 62.1% accurate, 11.4× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.014 \lor \neg \left(z \leq 0.029\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 -0.014) (not (<= z 0.029))) (* (- t x) z) (fma (- x) z x)))
                                    double code(double x, double y, double z, double t) {
                                    	double tmp;
                                    	if ((z <= -0.014) || !(z <= 0.029)) {
                                    		tmp = (t - x) * z;
                                    	} else {
                                    		tmp = fma(-x, z, x);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(x, y, z, t)
                                    	tmp = 0.0
                                    	if ((z <= -0.014) || !(z <= 0.029))
                                    		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, -0.014], N[Not[LessEqual[z, 0.029]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision], N[((-x) * z + x), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;z \leq -0.014 \lor \neg \left(z \leq 0.029\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 < -0.0140000000000000003 or 0.0290000000000000015 < z

                                      1. Initial program 88.4%

                                        \[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--.f6446.0

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

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

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

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

                                        if -0.0140000000000000003 < z < 0.0290000000000000015

                                        1. Initial program 99.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--.f6474.7

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

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

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

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

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

                                        Alternative 9: 20.8% accurate, 11.9× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-86} \lor \neg \left(x \leq 5 \cdot 10^{-64}\right):\\ \;\;\;\;\left(-x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \end{array} \]
                                        (FPCore (x y z t)
                                         :precision binary64
                                         (if (or (<= x -3.1e-86) (not (<= x 5e-64))) (* (- x) z) (* z t)))
                                        double code(double x, double y, double z, double t) {
                                        	double tmp;
                                        	if ((x <= -3.1e-86) || !(x <= 5e-64)) {
                                        		tmp = -x * z;
                                        	} else {
                                        		tmp = z * t;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        real(8) function code(x, y, z, t)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            real(8), intent (in) :: z
                                            real(8), intent (in) :: t
                                            real(8) :: tmp
                                            if ((x <= (-3.1d-86)) .or. (.not. (x <= 5d-64))) then
                                                tmp = -x * z
                                            else
                                                tmp = z * t
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double x, double y, double z, double t) {
                                        	double tmp;
                                        	if ((x <= -3.1e-86) || !(x <= 5e-64)) {
                                        		tmp = -x * z;
                                        	} else {
                                        		tmp = z * t;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(x, y, z, t):
                                        	tmp = 0
                                        	if (x <= -3.1e-86) or not (x <= 5e-64):
                                        		tmp = -x * z
                                        	else:
                                        		tmp = z * t
                                        	return tmp
                                        
                                        function code(x, y, z, t)
                                        	tmp = 0.0
                                        	if ((x <= -3.1e-86) || !(x <= 5e-64))
                                        		tmp = Float64(Float64(-x) * z);
                                        	else
                                        		tmp = Float64(z * t);
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(x, y, z, t)
                                        	tmp = 0.0;
                                        	if ((x <= -3.1e-86) || ~((x <= 5e-64)))
                                        		tmp = -x * z;
                                        	else
                                        		tmp = z * t;
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1e-86], N[Not[LessEqual[x, 5e-64]], $MachinePrecision]], N[((-x) * z), $MachinePrecision], N[(z * t), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;x \leq -3.1 \cdot 10^{-86} \lor \neg \left(x \leq 5 \cdot 10^{-64}\right):\\
                                        \;\;\;\;\left(-x\right) \cdot z\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;z \cdot t\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if x < -3.09999999999999989e-86 or 5.00000000000000033e-64 < x

                                          1. Initial program 95.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--.f6458.9

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

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

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

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

                                              \[\leadsto \left(-1 \cdot x\right) \cdot z \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites17.1%

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

                                              if -3.09999999999999989e-86 < x < 5.00000000000000033e-64

                                              1. Initial program 90.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--.f6459.2

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

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

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

                                                  \[\leadsto t \cdot \color{blue}{z} \]
                                              8. Recombined 2 regimes into one program.
                                              9. Final simplification25.6%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-86} \lor \neg \left(x \leq 5 \cdot 10^{-64}\right):\\ \;\;\;\;\left(-x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]
                                              10. Add Preprocessing

                                              Alternative 10: 60.6% accurate, 14.9× speedup?

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

                                                1. Initial program 95.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 x + \color{blue}{z \cdot \left(t - x\right)} \]
                                                4. Step-by-step derivation
                                                  1. *-commutativeN/A

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

                                                    \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                                                  3. lower--.f6452.6

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

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

                                                  \[\leadsto x + t \cdot \color{blue}{z} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites59.0%

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

                                                  if 2.55000000000000004e-80 < y

                                                  1. Initial program 89.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--.f6472.8

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

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

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

                                                Alternative 11: 26.8% 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;
                                                }
                                                
                                                real(8) function code(x, y, z, t)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    real(8), intent (in) :: z
                                                    real(8), intent (in) :: t
                                                    code = (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 93.4%

                                                  \[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--.f6459.0

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

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

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

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

                                                  Alternative 12: 16.9% 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;
                                                  }
                                                  
                                                  real(8) function code(x, y, z, t)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      real(8), intent (in) :: z
                                                      real(8), intent (in) :: t
                                                      code = z * t
                                                  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 93.4%

                                                    \[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--.f6459.0

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

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

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

                                                      \[\leadsto t \cdot \color{blue}{z} \]
                                                    2. Final simplification20.4%

                                                      \[\leadsto z \cdot t \]
                                                    3. Add Preprocessing

                                                    Developer Target 1: 97.1% 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)))));
                                                    }
                                                    
                                                    real(8) function code(x, y, z, t)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        real(8), intent (in) :: z
                                                        real(8), intent (in) :: t
                                                        code = x + (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 2024271 
                                                    (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))))))