Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A

Percentage Accurate: 86.1% → 98.1%
Time: 5.3s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a):
	return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - z) * t) / (a - z));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 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: 86.1% accurate, 1.0× speedup?

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

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a):
	return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - z) * t) / (a - z));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 98.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} + x \]
    9. sub-divN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - z}{a - z}}, t, x\right) \]
    13. sub-negate-revN/A

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}}{a - z}, t, x\right) \]
    14. sub-negate-revN/A

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

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

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

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

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

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

Alternative 2: 83.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, t, x\right)\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-96}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z - y}{z}, t, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.6e-7)
   (fma (/ z (- z a)) t x)
   (if (<= z 1.3e-96) (fma t (/ (- y z) a) x) (fma (/ (- z y) z) t x))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.6e-7) {
		tmp = fma((z / (z - a)), t, x);
	} else if (z <= 1.3e-96) {
		tmp = fma(t, ((y - z) / a), x);
	} else {
		tmp = fma(((z - y) / z), t, x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.6e-7)
		tmp = fma(Float64(z / Float64(z - a)), t, x);
	elseif (z <= 1.3e-96)
		tmp = fma(t, Float64(Float64(y - z) / a), x);
	else
		tmp = fma(Float64(Float64(z - y) / z), t, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e-7], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 1.3e-96], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * t + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, t, x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.59999999999999994e-7

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} + x \]
      9. sub-divN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - z}{a - z}}, t, x\right) \]
      13. sub-negate-revN/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}}{a - z}, t, x\right) \]
      14. sub-negate-revN/A

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

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

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

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

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

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

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

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

      if -3.59999999999999994e-7 < z < 1.3000000000000001e-96

      1. Initial program 86.1%

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

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

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

          \[\leadsto t \cdot \frac{y - z}{a} + x \]
        3. lower-fma.f64N/A

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

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

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

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

      if 1.3000000000000001e-96 < z

      1. Initial program 86.1%

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} + x \]
        9. sub-divN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - z}{a - z}}, t, x\right) \]
        13. sub-negate-revN/A

          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}}{a - z}, t, x\right) \]
        14. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 82.8% accurate, 0.8× speedup?

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

      1. Initial program 86.1%

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} + x \]
        9. sub-divN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - z}{a - z}}, t, x\right) \]
        13. sub-negate-revN/A

          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}}{a - z}, t, x\right) \]
        14. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

      if -6.1999999999999999e-7 < z < 1.3000000000000001e-96

      1. Initial program 86.1%

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

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

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

          \[\leadsto t \cdot \frac{y - z}{a} + x \]
        3. lower-fma.f64N/A

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

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

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

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

    Alternative 4: 78.4% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{-5}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-96}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+85}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (if (<= z -4.1e-5)
       (+ x t)
       (if (<= z 1.3e-96)
         (fma t (/ (- y z) a) x)
         (if (<= z 6.6e+85) (fma (/ (- y) z) t x) (+ x t)))))
    double code(double x, double y, double z, double t, double a) {
    	double tmp;
    	if (z <= -4.1e-5) {
    		tmp = x + t;
    	} else if (z <= 1.3e-96) {
    		tmp = fma(t, ((y - z) / a), x);
    	} else if (z <= 6.6e+85) {
    		tmp = fma((-y / z), t, x);
    	} else {
    		tmp = x + t;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a)
    	tmp = 0.0
    	if (z <= -4.1e-5)
    		tmp = Float64(x + t);
    	elseif (z <= 1.3e-96)
    		tmp = fma(t, Float64(Float64(y - z) / a), x);
    	elseif (z <= 6.6e+85)
    		tmp = fma(Float64(Float64(-y) / z), t, x);
    	else
    		tmp = Float64(x + t);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.1e-5], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.3e-96], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 6.6e+85], N[(N[((-y) / z), $MachinePrecision] * t + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -4.1 \cdot 10^{-5}:\\
    \;\;\;\;x + t\\
    
    \mathbf{elif}\;z \leq 1.3 \cdot 10^{-96}:\\
    \;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
    
    \mathbf{elif}\;z \leq 6.6 \cdot 10^{+85}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, t, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x + t\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -4.10000000000000005e-5 or 6.5999999999999998e85 < z

      1. Initial program 86.1%

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

        \[\leadsto x + \color{blue}{t} \]
      3. Step-by-step derivation
        1. Applied rewrites59.9%

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

        if -4.10000000000000005e-5 < z < 1.3000000000000001e-96

        1. Initial program 86.1%

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

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

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

            \[\leadsto t \cdot \frac{y - z}{a} + x \]
          3. lower-fma.f64N/A

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

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

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

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

        if 1.3000000000000001e-96 < z < 6.5999999999999998e85

        1. Initial program 86.1%

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} + x \]
          9. sub-divN/A

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

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - z}{a - z}}, t, x\right) \]
          13. sub-negate-revN/A

            \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}}{a - z}, t, x\right) \]
          14. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(-\frac{y - a}{z}\right) + 1, t, x\right) \]
          6. lower--.f6460.1

            \[\leadsto \mathsf{fma}\left(\left(-\frac{y - a}{z}\right) + 1, t, x\right) \]
        6. Applied rewrites60.1%

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

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

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

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

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

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

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

      Alternative 5: 77.5% accurate, 0.7× speedup?

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

        1. Initial program 86.1%

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

          \[\leadsto x + \color{blue}{t} \]
        3. Step-by-step derivation
          1. Applied rewrites59.9%

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

          if -3.1e-6 < z < 1.3000000000000001e-96

          1. Initial program 86.1%

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

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

              \[\leadsto \frac{t \cdot y}{a} + \color{blue}{x} \]
            2. associate-/l*N/A

              \[\leadsto t \cdot \frac{y}{a} + x \]
            3. lower-fma.f64N/A

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

              \[\leadsto \mathsf{fma}\left(t, \frac{y}{\color{blue}{a}}, x\right) \]
          4. Applied rewrites62.7%

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

          if 1.3000000000000001e-96 < z < 6.5999999999999998e85

          1. Initial program 86.1%

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} + x \]
            9. sub-divN/A

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

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - z}{a - z}}, t, x\right) \]
            13. sub-negate-revN/A

              \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}}{a - z}, t, x\right) \]
            14. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(-\frac{y - a}{z}\right) + 1, t, x\right) \]
            6. lower--.f6460.1

              \[\leadsto \mathsf{fma}\left(\left(-\frac{y - a}{z}\right) + 1, t, x\right) \]
          6. Applied rewrites60.1%

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

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

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

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

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

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

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

        Alternative 6: 77.5% accurate, 0.7× speedup?

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

          1. Initial program 86.1%

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

            \[\leadsto x + \color{blue}{t} \]
          3. Step-by-step derivation
            1. Applied rewrites59.9%

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

            if -3.1e-6 < z < 1.3000000000000001e-96

            1. Initial program 86.1%

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

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

                \[\leadsto \frac{t \cdot y}{a} + \color{blue}{x} \]
              2. associate-/l*N/A

                \[\leadsto t \cdot \frac{y}{a} + x \]
              3. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(t, \frac{y}{\color{blue}{a}}, x\right) \]
            4. Applied rewrites62.7%

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

            if 1.3000000000000001e-96 < z < 3.19999999999999982e59

            1. Initial program 86.1%

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

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

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

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

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

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

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

                \[\leadsto x - \frac{\mathsf{neg}\left(t \cdot \left(y - z\right)\right)}{\mathsf{neg}\left(z\right)} \]
              7. frac-2negN/A

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

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

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

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

                \[\leadsto x - \frac{\left(y - z\right) \cdot t}{z} \]
              12. lift-*.f6458.7

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

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

              \[\leadsto x - \frac{t \cdot y}{z} \]
            6. Step-by-step derivation
              1. lower-*.f6452.5

                \[\leadsto x - \frac{t \cdot y}{z} \]
            7. Applied rewrites52.5%

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

          Alternative 7: 77.5% accurate, 0.9× speedup?

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

            1. Initial program 86.1%

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

              \[\leadsto x + \color{blue}{t} \]
            3. Step-by-step derivation
              1. Applied rewrites59.9%

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

              if -3.1e-6 < z < 7.6000000000000001e-6

              1. Initial program 86.1%

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

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

                  \[\leadsto \frac{t \cdot y}{a} + \color{blue}{x} \]
                2. associate-/l*N/A

                  \[\leadsto t \cdot \frac{y}{a} + x \]
                3. lower-fma.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(t, \frac{y}{\color{blue}{a}}, x\right) \]
              4. Applied rewrites62.7%

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

            Alternative 8: 59.9% accurate, 1.3× speedup?

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

              1. Initial program 86.1%

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

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

                  \[\leadsto t \cdot \color{blue}{\frac{y}{a - z}} \]
                2. lower-*.f64N/A

                  \[\leadsto t \cdot \color{blue}{\frac{y}{a - z}} \]
                3. lower-/.f64N/A

                  \[\leadsto t \cdot \frac{y}{\color{blue}{a - z}} \]
                4. lift--.f6429.0

                  \[\leadsto t \cdot \frac{y}{a - \color{blue}{z}} \]
              4. Applied rewrites29.0%

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

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

                  \[\leadsto t \cdot \frac{-1 \cdot y}{z} \]
                2. lower-/.f64N/A

                  \[\leadsto t \cdot \frac{-1 \cdot y}{z} \]
                3. mul-1-negN/A

                  \[\leadsto t \cdot \frac{\mathsf{neg}\left(y\right)}{z} \]
                4. lower-neg.f6415.5

                  \[\leadsto t \cdot \frac{-y}{z} \]
              7. Applied rewrites15.5%

                \[\leadsto t \cdot \frac{-y}{\color{blue}{z}} \]

              if -1.6000000000000001e138 < y

              1. Initial program 86.1%

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

                \[\leadsto x + \color{blue}{t} \]
              3. Step-by-step derivation
                1. Applied rewrites59.9%

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

              Alternative 9: 59.6% accurate, 1.4× speedup?

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

                1. Initial program 86.1%

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

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

                    \[\leadsto t \cdot \color{blue}{\frac{y}{a - z}} \]
                  2. lower-*.f64N/A

                    \[\leadsto t \cdot \color{blue}{\frac{y}{a - z}} \]
                  3. lower-/.f64N/A

                    \[\leadsto t \cdot \frac{y}{\color{blue}{a - z}} \]
                  4. lift--.f6429.0

                    \[\leadsto t \cdot \frac{y}{a - \color{blue}{z}} \]
                4. Applied rewrites29.0%

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

                  \[\leadsto t \cdot \frac{y}{a} \]
                6. Step-by-step derivation
                  1. Applied rewrites20.7%

                    \[\leadsto t \cdot \frac{y}{a} \]

                  if -1.6000000000000001e138 < y

                  1. Initial program 86.1%

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

                    \[\leadsto x + \color{blue}{t} \]
                  3. Step-by-step derivation
                    1. Applied rewrites59.9%

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

                  Alternative 10: 59.1% accurate, 1.4× speedup?

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

                    1. Initial program 86.1%

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

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

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

                        \[\leadsto t \cdot \frac{y - z}{a} + x \]
                      3. lower-fma.f64N/A

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

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

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

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

                      \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
                    6. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{t \cdot y}{a} \]
                      2. lower-*.f6419.0

                        \[\leadsto \frac{t \cdot y}{a} \]
                    7. Applied rewrites19.0%

                      \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]

                    if -1.6000000000000001e138 < y

                    1. Initial program 86.1%

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

                      \[\leadsto x + \color{blue}{t} \]
                    3. Step-by-step derivation
                      1. Applied rewrites59.9%

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

                    Alternative 11: 58.7% accurate, 4.1× speedup?

                    \[\begin{array}{l} \\ x + t \end{array} \]
                    (FPCore (x y z t a) :precision binary64 (+ x t))
                    double code(double x, double y, double z, double t, double a) {
                    	return x + t;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z, t, a)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8), intent (in) :: a
                        code = x + t
                    end function
                    
                    public static double code(double x, double y, double z, double t, double a) {
                    	return x + t;
                    }
                    
                    def code(x, y, z, t, a):
                    	return x + t
                    
                    function code(x, y, z, t, a)
                    	return Float64(x + t)
                    end
                    
                    function tmp = code(x, y, z, t, a)
                    	tmp = x + t;
                    end
                    
                    code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    x + t
                    \end{array}
                    
                    Derivation
                    1. Initial program 86.1%

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

                      \[\leadsto x + \color{blue}{t} \]
                    3. Step-by-step derivation
                      1. Applied rewrites59.9%

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

                      Reproduce

                      ?
                      herbie shell --seed 2025136 
                      (FPCore (x y z t a)
                        :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
                        :precision binary64
                        (+ x (/ (* (- y z) t) (- a z))))