Linear.Matrix:det44 from linear-1.19.1.3

Percentage Accurate: 29.9% → 54.7%
Time: 23.1s
Alternatives: 32
Speedup: 5.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (+
  (-
   (+
    (+
     (-
      (* (- (* x y) (* z t)) (- (* a b) (* c i)))
      (* (- (* x j) (* z k)) (- (* y0 b) (* y1 i))))
     (* (- (* x y2) (* z y3)) (- (* y0 c) (* y1 a))))
    (* (- (* t j) (* y k)) (- (* y4 b) (* y5 i))))
   (* (- (* t y2) (* y y3)) (- (* y4 c) (* y5 a))))
  (* (- (* k y2) (* j y3)) (- (* y4 y1) (* y5 y0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	return (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)));
}
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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    code = (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	return (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)));
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	return (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)))
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) - Float64(z * t)) * Float64(Float64(a * b) - Float64(c * i))) - Float64(Float64(Float64(x * j) - Float64(z * k)) * Float64(Float64(y0 * b) - Float64(y1 * i)))) + Float64(Float64(Float64(x * y2) - Float64(z * y3)) * Float64(Float64(y0 * c) - Float64(y1 * a)))) + Float64(Float64(Float64(t * j) - Float64(y * k)) * Float64(Float64(y4 * b) - Float64(y5 * i)))) - Float64(Float64(Float64(t * y2) - Float64(y * y3)) * Float64(Float64(y4 * c) - Float64(y5 * a)))) + Float64(Float64(Float64(k * y2) - Float64(j * y3)) * Float64(Float64(y4 * y1) - Float64(y5 * y0))))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] * N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x * j), $MachinePrecision] - N[(z * k), $MachinePrecision]), $MachinePrecision] * N[(N[(y0 * b), $MachinePrecision] - N[(y1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * y2), $MachinePrecision] - N[(z * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y0 * c), $MachinePrecision] - N[(y1 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t * j), $MachinePrecision] - N[(y * k), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * b), $MachinePrecision] - N[(y5 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t * y2), $MachinePrecision] - N[(y * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * c), $MachinePrecision] - N[(y5 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * y1), $MachinePrecision] - N[(y5 * y0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right)
\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 32 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: 29.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (+
  (-
   (+
    (+
     (-
      (* (- (* x y) (* z t)) (- (* a b) (* c i)))
      (* (- (* x j) (* z k)) (- (* y0 b) (* y1 i))))
     (* (- (* x y2) (* z y3)) (- (* y0 c) (* y1 a))))
    (* (- (* t j) (* y k)) (- (* y4 b) (* y5 i))))
   (* (- (* t y2) (* y y3)) (- (* y4 c) (* y5 a))))
  (* (- (* k y2) (* j y3)) (- (* y4 y1) (* y5 y0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	return (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)));
}
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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    code = (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	return (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)));
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	return (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)))
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) - Float64(z * t)) * Float64(Float64(a * b) - Float64(c * i))) - Float64(Float64(Float64(x * j) - Float64(z * k)) * Float64(Float64(y0 * b) - Float64(y1 * i)))) + Float64(Float64(Float64(x * y2) - Float64(z * y3)) * Float64(Float64(y0 * c) - Float64(y1 * a)))) + Float64(Float64(Float64(t * j) - Float64(y * k)) * Float64(Float64(y4 * b) - Float64(y5 * i)))) - Float64(Float64(Float64(t * y2) - Float64(y * y3)) * Float64(Float64(y4 * c) - Float64(y5 * a)))) + Float64(Float64(Float64(k * y2) - Float64(j * y3)) * Float64(Float64(y4 * y1) - Float64(y5 * y0))))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = (((((((x * y) - (z * t)) * ((a * b) - (c * i))) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] * N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x * j), $MachinePrecision] - N[(z * k), $MachinePrecision]), $MachinePrecision] * N[(N[(y0 * b), $MachinePrecision] - N[(y1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * y2), $MachinePrecision] - N[(z * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y0 * c), $MachinePrecision] - N[(y1 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t * j), $MachinePrecision] - N[(y * k), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * b), $MachinePrecision] - N[(y5 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t * y2), $MachinePrecision] - N[(y * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * c), $MachinePrecision] - N[(y5 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * y1), $MachinePrecision] - N[(y5 * y0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right)
\end{array}

Alternative 1: 54.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot y0 - a \cdot y1\\ t_2 := k \cdot y2 - j \cdot y3\\ t_3 := y1 \cdot y4 - y0 \cdot y5\\ t_4 := a \cdot b - c \cdot i\\ t_5 := b \cdot y0 - i \cdot y1\\ t_6 := x \cdot \left(\mathsf{fma}\left(y, t\_4, y2 \cdot t\_1\right) - j \cdot t\_5\right)\\ \mathbf{if}\;x \leq -2 \cdot 10^{+128}:\\ \;\;\;\;t\_6\\ \mathbf{elif}\;x \leq -46000:\\ \;\;\;\;-1 \cdot \left(y3 \cdot \left(\mathsf{fma}\left(j, t\_3, z \cdot t\_1\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\right)\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-180}:\\ \;\;\;\;y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot t\_2, c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-242}:\\ \;\;\;\;k \cdot \left(\mathsf{fma}\left(-1, y \cdot \left(b \cdot y4 - i \cdot y5\right), y2 \cdot t\_3\right) - -1 \cdot \left(z \cdot t\_5\right)\right)\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-198}:\\ \;\;\;\;y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot t\_2\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-68}:\\ \;\;\;\;-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, t\_4, y3 \cdot t\_1\right) - k \cdot t\_5\right)\right)\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+261}:\\ \;\;\;\;t\_6\\ \mathbf{else}:\\ \;\;\;\;y2 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot y1 - t \cdot y5\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (- (* c y0) (* a y1)))
        (t_2 (- (* k y2) (* j y3)))
        (t_3 (- (* y1 y4) (* y0 y5)))
        (t_4 (- (* a b) (* c i)))
        (t_5 (- (* b y0) (* i y1)))
        (t_6 (* x (- (fma y t_4 (* y2 t_1)) (* j t_5)))))
   (if (<= x -2e+128)
     t_6
     (if (<= x -46000.0)
       (* -1.0 (* y3 (- (fma j t_3 (* z t_1)) (* y (- (* c y4) (* a y5))))))
       (if (<= x -2.6e-180)
         (*
          y0
          (-
           (fma -1.0 (* y5 t_2) (* c (- (* x y2) (* y3 z))))
           (* b (- (* j x) (* k z)))))
         (if (<= x -2.1e-242)
           (*
            k
            (-
             (fma -1.0 (* y (- (* b y4) (* i y5))) (* y2 t_3))
             (* -1.0 (* z t_5))))
           (if (<= x 2e-198)
             (*
              y4
              (-
               (fma b (- (* j t) (* k y)) (* y1 t_2))
               (* c (- (* t y2) (* y y3)))))
             (if (<= x 8e-68)
               (* -1.0 (* z (- (fma t t_4 (* y3 t_1)) (* k t_5))))
               (if (<= x 1.15e+261)
                 t_6
                 (* y2 (* -1.0 (* a (- (* x y1) (* t y5))))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = (c * y0) - (a * y1);
	double t_2 = (k * y2) - (j * y3);
	double t_3 = (y1 * y4) - (y0 * y5);
	double t_4 = (a * b) - (c * i);
	double t_5 = (b * y0) - (i * y1);
	double t_6 = x * (fma(y, t_4, (y2 * t_1)) - (j * t_5));
	double tmp;
	if (x <= -2e+128) {
		tmp = t_6;
	} else if (x <= -46000.0) {
		tmp = -1.0 * (y3 * (fma(j, t_3, (z * t_1)) - (y * ((c * y4) - (a * y5)))));
	} else if (x <= -2.6e-180) {
		tmp = y0 * (fma(-1.0, (y5 * t_2), (c * ((x * y2) - (y3 * z)))) - (b * ((j * x) - (k * z))));
	} else if (x <= -2.1e-242) {
		tmp = k * (fma(-1.0, (y * ((b * y4) - (i * y5))), (y2 * t_3)) - (-1.0 * (z * t_5)));
	} else if (x <= 2e-198) {
		tmp = y4 * (fma(b, ((j * t) - (k * y)), (y1 * t_2)) - (c * ((t * y2) - (y * y3))));
	} else if (x <= 8e-68) {
		tmp = -1.0 * (z * (fma(t, t_4, (y3 * t_1)) - (k * t_5)));
	} else if (x <= 1.15e+261) {
		tmp = t_6;
	} else {
		tmp = y2 * (-1.0 * (a * ((x * y1) - (t * y5))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(c * y0) - Float64(a * y1))
	t_2 = Float64(Float64(k * y2) - Float64(j * y3))
	t_3 = Float64(Float64(y1 * y4) - Float64(y0 * y5))
	t_4 = Float64(Float64(a * b) - Float64(c * i))
	t_5 = Float64(Float64(b * y0) - Float64(i * y1))
	t_6 = Float64(x * Float64(fma(y, t_4, Float64(y2 * t_1)) - Float64(j * t_5)))
	tmp = 0.0
	if (x <= -2e+128)
		tmp = t_6;
	elseif (x <= -46000.0)
		tmp = Float64(-1.0 * Float64(y3 * Float64(fma(j, t_3, Float64(z * t_1)) - Float64(y * Float64(Float64(c * y4) - Float64(a * y5))))));
	elseif (x <= -2.6e-180)
		tmp = Float64(y0 * Float64(fma(-1.0, Float64(y5 * t_2), Float64(c * Float64(Float64(x * y2) - Float64(y3 * z)))) - Float64(b * Float64(Float64(j * x) - Float64(k * z)))));
	elseif (x <= -2.1e-242)
		tmp = Float64(k * Float64(fma(-1.0, Float64(y * Float64(Float64(b * y4) - Float64(i * y5))), Float64(y2 * t_3)) - Float64(-1.0 * Float64(z * t_5))));
	elseif (x <= 2e-198)
		tmp = Float64(y4 * Float64(fma(b, Float64(Float64(j * t) - Float64(k * y)), Float64(y1 * t_2)) - Float64(c * Float64(Float64(t * y2) - Float64(y * y3)))));
	elseif (x <= 8e-68)
		tmp = Float64(-1.0 * Float64(z * Float64(fma(t, t_4, Float64(y3 * t_1)) - Float64(k * t_5))));
	elseif (x <= 1.15e+261)
		tmp = t_6;
	else
		tmp = Float64(y2 * Float64(-1.0 * Float64(a * Float64(Float64(x * y1) - Float64(t * y5)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(b * y0), $MachinePrecision] - N[(i * y1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x * N[(N[(y * t$95$4 + N[(y2 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(j * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+128], t$95$6, If[LessEqual[x, -46000.0], N[(-1.0 * N[(y3 * N[(N[(j * t$95$3 + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(c * y4), $MachinePrecision] - N[(a * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e-180], N[(y0 * N[(N[(-1.0 * N[(y5 * t$95$2), $MachinePrecision] + N[(c * N[(N[(x * y2), $MachinePrecision] - N[(y3 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(j * x), $MachinePrecision] - N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.1e-242], N[(k * N[(N[(-1.0 * N[(y * N[(N[(b * y4), $MachinePrecision] - N[(i * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y2 * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(z * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e-198], N[(y4 * N[(N[(b * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision] + N[(y1 * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(c * N[(N[(t * y2), $MachinePrecision] - N[(y * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-68], N[(-1.0 * N[(z * N[(N[(t * t$95$4 + N[(y3 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(k * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e+261], t$95$6, N[(y2 * N[(-1.0 * N[(a * N[(N[(x * y1), $MachinePrecision] - N[(t * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot y0 - a \cdot y1\\
t_2 := k \cdot y2 - j \cdot y3\\
t_3 := y1 \cdot y4 - y0 \cdot y5\\
t_4 := a \cdot b - c \cdot i\\
t_5 := b \cdot y0 - i \cdot y1\\
t_6 := x \cdot \left(\mathsf{fma}\left(y, t\_4, y2 \cdot t\_1\right) - j \cdot t\_5\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{+128}:\\
\;\;\;\;t\_6\\

\mathbf{elif}\;x \leq -46000:\\
\;\;\;\;-1 \cdot \left(y3 \cdot \left(\mathsf{fma}\left(j, t\_3, z \cdot t\_1\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\right)\\

\mathbf{elif}\;x \leq -2.6 \cdot 10^{-180}:\\
\;\;\;\;y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot t\_2, c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)\\

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-242}:\\
\;\;\;\;k \cdot \left(\mathsf{fma}\left(-1, y \cdot \left(b \cdot y4 - i \cdot y5\right), y2 \cdot t\_3\right) - -1 \cdot \left(z \cdot t\_5\right)\right)\\

\mathbf{elif}\;x \leq 2 \cdot 10^{-198}:\\
\;\;\;\;y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot t\_2\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)\\

\mathbf{elif}\;x \leq 8 \cdot 10^{-68}:\\
\;\;\;\;-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, t\_4, y3 \cdot t\_1\right) - k \cdot t\_5\right)\right)\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{+261}:\\
\;\;\;\;t\_6\\

\mathbf{else}:\\
\;\;\;\;y2 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot y1 - t \cdot y5\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if x < -2.0000000000000002e128 or 8.00000000000000053e-68 < x < 1.15000000000000003e261

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]

    if -2.0000000000000002e128 < x < -46000

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y3 around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(y3 \cdot \left(\left(j \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(y3 \cdot \left(\left(j \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(\left(j \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(\left(j \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{y \cdot \left(c \cdot y4 - a \cdot y5\right)}\right)\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{-1 \cdot \left(y3 \cdot \left(\mathsf{fma}\left(j, y1 \cdot y4 - y0 \cdot y5, z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\right)} \]

    if -46000 < x < -2.5999999999999999e-180

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y0 around inf

      \[\leadsto \color{blue}{y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \color{blue}{\left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - \color{blue}{b \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot \left(k \cdot y2 - j \cdot y3\right), c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]

    if -2.5999999999999999e-180 < x < -2.10000000000000019e-242

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in k around inf

      \[\leadsto \color{blue}{k \cdot \left(\left(-1 \cdot \left(y \cdot \left(b \cdot y4 - i \cdot y5\right)\right) + y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) - -1 \cdot \left(z \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto k \cdot \color{blue}{\left(\left(-1 \cdot \left(y \cdot \left(b \cdot y4 - i \cdot y5\right)\right) + y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) - -1 \cdot \left(z \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto k \cdot \left(\left(-1 \cdot \left(y \cdot \left(b \cdot y4 - i \cdot y5\right)\right) + y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) - \color{blue}{-1 \cdot \left(z \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
    4. Applied rewrites36.1%

      \[\leadsto \color{blue}{k \cdot \left(\mathsf{fma}\left(-1, y \cdot \left(b \cdot y4 - i \cdot y5\right), y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) - -1 \cdot \left(z \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]

    if -2.10000000000000019e-242 < x < 1.9999999999999998e-198

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]

    if 1.9999999999999998e-198 < x < 8.00000000000000053e-68

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]

    if 1.15000000000000003e261 < x

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in a around -inf

      \[\leadsto y2 \cdot \left(-1 \cdot \color{blue}{\left(a \cdot \left(x \cdot y1 - t \cdot y5\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(-1 \cdot \left(a \cdot \color{blue}{\left(x \cdot y1 - t \cdot y5\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot y1 - \color{blue}{t \cdot y5}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y2 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot y1 - t \cdot \color{blue}{y5}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot y1 - t \cdot y5\right)\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto y2 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot y1 - t \cdot y5\right)\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto y2 \cdot \left(-1 \cdot \color{blue}{\left(a \cdot \left(x \cdot y1 - t \cdot y5\right)\right)}\right) \]
  3. Recombined 7 regimes into one program.
  4. Add Preprocessing

Alternative 2: 43.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b - c \cdot i\\ t_2 := y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)\\ t_3 := c \cdot y0 - a \cdot y1\\ t_4 := c \cdot y4 - a \cdot y5\\ \mathbf{if}\;y4 \leq -1.6 \cdot 10^{+100}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y4 \leq -8 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \left(\mathsf{fma}\left(y, t\_1, y2 \cdot t\_3\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\\ \mathbf{elif}\;y4 \leq -9.2 \cdot 10^{-129}:\\ \;\;\;\;t \cdot \left(\mathsf{fma}\left(-1, z \cdot t\_1, j \cdot \left(b \cdot y4 - i \cdot y5\right)\right) - y2 \cdot t\_4\right)\\ \mathbf{elif}\;y4 \leq -1.62 \cdot 10^{-226}:\\ \;\;\;\;a \cdot \left(x \cdot \mathsf{fma}\left(-1, y1 \cdot y2, b \cdot y\right)\right)\\ \mathbf{elif}\;y4 \leq 3.8 \cdot 10^{-127}:\\ \;\;\;\;-1 \cdot \left(y3 \cdot \left(\mathsf{fma}\left(j, y1 \cdot y4 - y0 \cdot y5, z \cdot t\_3\right) - y \cdot t\_4\right)\right)\\ \mathbf{elif}\;y4 \leq 2.1 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \left(y \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (- (* a b) (* c i)))
        (t_2
         (*
          y4
          (-
           (fma b (- (* j t) (* k y)) (* y1 (- (* k y2) (* j y3))))
           (* c (- (* t y2) (* y y3))))))
        (t_3 (- (* c y0) (* a y1)))
        (t_4 (- (* c y4) (* a y5))))
   (if (<= y4 -1.6e+100)
     t_2
     (if (<= y4 -8e-6)
       (* x (- (fma y t_1 (* y2 t_3)) (* j (- (* b y0) (* i y1)))))
       (if (<= y4 -9.2e-129)
         (* t (- (fma -1.0 (* z t_1) (* j (- (* b y4) (* i y5)))) (* y2 t_4)))
         (if (<= y4 -1.62e-226)
           (* a (* x (fma -1.0 (* y1 y2) (* b y))))
           (if (<= y4 3.8e-127)
             (*
              -1.0
              (* y3 (- (fma j (- (* y1 y4) (* y0 y5)) (* z t_3)) (* y t_4))))
             (if (<= y4 2.1e+30) (* x (* y t_1)) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = (a * b) - (c * i);
	double t_2 = y4 * (fma(b, ((j * t) - (k * y)), (y1 * ((k * y2) - (j * y3)))) - (c * ((t * y2) - (y * y3))));
	double t_3 = (c * y0) - (a * y1);
	double t_4 = (c * y4) - (a * y5);
	double tmp;
	if (y4 <= -1.6e+100) {
		tmp = t_2;
	} else if (y4 <= -8e-6) {
		tmp = x * (fma(y, t_1, (y2 * t_3)) - (j * ((b * y0) - (i * y1))));
	} else if (y4 <= -9.2e-129) {
		tmp = t * (fma(-1.0, (z * t_1), (j * ((b * y4) - (i * y5)))) - (y2 * t_4));
	} else if (y4 <= -1.62e-226) {
		tmp = a * (x * fma(-1.0, (y1 * y2), (b * y)));
	} else if (y4 <= 3.8e-127) {
		tmp = -1.0 * (y3 * (fma(j, ((y1 * y4) - (y0 * y5)), (z * t_3)) - (y * t_4)));
	} else if (y4 <= 2.1e+30) {
		tmp = x * (y * t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(a * b) - Float64(c * i))
	t_2 = Float64(y4 * Float64(fma(b, Float64(Float64(j * t) - Float64(k * y)), Float64(y1 * Float64(Float64(k * y2) - Float64(j * y3)))) - Float64(c * Float64(Float64(t * y2) - Float64(y * y3)))))
	t_3 = Float64(Float64(c * y0) - Float64(a * y1))
	t_4 = Float64(Float64(c * y4) - Float64(a * y5))
	tmp = 0.0
	if (y4 <= -1.6e+100)
		tmp = t_2;
	elseif (y4 <= -8e-6)
		tmp = Float64(x * Float64(fma(y, t_1, Float64(y2 * t_3)) - Float64(j * Float64(Float64(b * y0) - Float64(i * y1)))));
	elseif (y4 <= -9.2e-129)
		tmp = Float64(t * Float64(fma(-1.0, Float64(z * t_1), Float64(j * Float64(Float64(b * y4) - Float64(i * y5)))) - Float64(y2 * t_4)));
	elseif (y4 <= -1.62e-226)
		tmp = Float64(a * Float64(x * fma(-1.0, Float64(y1 * y2), Float64(b * y))));
	elseif (y4 <= 3.8e-127)
		tmp = Float64(-1.0 * Float64(y3 * Float64(fma(j, Float64(Float64(y1 * y4) - Float64(y0 * y5)), Float64(z * t_3)) - Float64(y * t_4))));
	elseif (y4 <= 2.1e+30)
		tmp = Float64(x * Float64(y * t_1));
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y4 * N[(N[(b * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision] + N[(y1 * N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(N[(t * y2), $MachinePrecision] - N[(y * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(c * y4), $MachinePrecision] - N[(a * y5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y4, -1.6e+100], t$95$2, If[LessEqual[y4, -8e-6], N[(x * N[(N[(y * t$95$1 + N[(y2 * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(j * N[(N[(b * y0), $MachinePrecision] - N[(i * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, -9.2e-129], N[(t * N[(N[(-1.0 * N[(z * t$95$1), $MachinePrecision] + N[(j * N[(N[(b * y4), $MachinePrecision] - N[(i * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y2 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, -1.62e-226], N[(a * N[(x * N[(-1.0 * N[(y1 * y2), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, 3.8e-127], N[(-1.0 * N[(y3 * N[(N[(j * N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision] + N[(z * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(y * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, 2.1e+30], N[(x * N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b - c \cdot i\\
t_2 := y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)\\
t_3 := c \cdot y0 - a \cdot y1\\
t_4 := c \cdot y4 - a \cdot y5\\
\mathbf{if}\;y4 \leq -1.6 \cdot 10^{+100}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y4 \leq -8 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(y, t\_1, y2 \cdot t\_3\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\\

\mathbf{elif}\;y4 \leq -9.2 \cdot 10^{-129}:\\
\;\;\;\;t \cdot \left(\mathsf{fma}\left(-1, z \cdot t\_1, j \cdot \left(b \cdot y4 - i \cdot y5\right)\right) - y2 \cdot t\_4\right)\\

\mathbf{elif}\;y4 \leq -1.62 \cdot 10^{-226}:\\
\;\;\;\;a \cdot \left(x \cdot \mathsf{fma}\left(-1, y1 \cdot y2, b \cdot y\right)\right)\\

\mathbf{elif}\;y4 \leq 3.8 \cdot 10^{-127}:\\
\;\;\;\;-1 \cdot \left(y3 \cdot \left(\mathsf{fma}\left(j, y1 \cdot y4 - y0 \cdot y5, z \cdot t\_3\right) - y \cdot t\_4\right)\right)\\

\mathbf{elif}\;y4 \leq 2.1 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \left(y \cdot t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y4 < -1.5999999999999999e100 or 2.1e30 < y4

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]

    if -1.5999999999999999e100 < y4 < -7.99999999999999964e-6

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]

    if -7.99999999999999964e-6 < y4 < -9.1999999999999998e-129

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot \left(\left(-1 \cdot \left(z \cdot \left(a \cdot b - c \cdot i\right)\right) + j \cdot \left(b \cdot y4 - i \cdot y5\right)\right) - y2 \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto t \cdot \color{blue}{\left(\left(-1 \cdot \left(z \cdot \left(a \cdot b - c \cdot i\right)\right) + j \cdot \left(b \cdot y4 - i \cdot y5\right)\right) - y2 \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto t \cdot \left(\left(-1 \cdot \left(z \cdot \left(a \cdot b - c \cdot i\right)\right) + j \cdot \left(b \cdot y4 - i \cdot y5\right)\right) - \color{blue}{y2 \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites36.4%

      \[\leadsto \color{blue}{t \cdot \left(\mathsf{fma}\left(-1, z \cdot \left(a \cdot b - c \cdot i\right), j \cdot \left(b \cdot y4 - i \cdot y5\right)\right) - y2 \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]

    if -9.1999999999999998e-129 < y4 < -1.61999999999999997e-226

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in a around inf

      \[\leadsto a \cdot \color{blue}{\left(x \cdot \left(-1 \cdot \left(y1 \cdot y2\right) + b \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto a \cdot \left(x \cdot \color{blue}{\left(-1 \cdot \left(y1 \cdot y2\right) + b \cdot y\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto a \cdot \left(x \cdot \left(-1 \cdot \left(y1 \cdot y2\right) + \color{blue}{b \cdot y}\right)\right) \]
      3. lower-fma.f64N/A

        \[\leadsto a \cdot \left(x \cdot \mathsf{fma}\left(-1, y1 \cdot \color{blue}{y2}, b \cdot y\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto a \cdot \left(x \cdot \mathsf{fma}\left(-1, y1 \cdot y2, b \cdot y\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto a \cdot \left(x \cdot \mathsf{fma}\left(-1, y1 \cdot y2, b \cdot y\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto a \cdot \color{blue}{\left(x \cdot \mathsf{fma}\left(-1, y1 \cdot y2, b \cdot y\right)\right)} \]

    if -1.61999999999999997e-226 < y4 < 3.80000000000000003e-127

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y3 around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(y3 \cdot \left(\left(j \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(y3 \cdot \left(\left(j \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(\left(j \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(\left(j \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{y \cdot \left(c \cdot y4 - a \cdot y5\right)}\right)\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{-1 \cdot \left(y3 \cdot \left(\mathsf{fma}\left(j, y1 \cdot y4 - y0 \cdot y5, z \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - y \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\right)} \]

    if 3.80000000000000003e-127 < y4 < 2.1e30

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - \color{blue}{c \cdot i}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot \color{blue}{i}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
      4. lower-*.f6426.3

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
  3. Recombined 6 regimes into one program.
  4. Add Preprocessing

Alternative 3: 42.3% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b - c \cdot i\\ t_2 := y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)\\ t_3 := c \cdot y0 - a \cdot y1\\ \mathbf{if}\;y4 \leq -1.6 \cdot 10^{+100}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y4 \leq -4 \cdot 10^{-7}:\\ \;\;\;\;x \cdot \left(\mathsf{fma}\left(y, t\_1, y2 \cdot t\_3\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\\ \mathbf{elif}\;y4 \leq 1.5 \cdot 10^{-136}:\\ \;\;\;\;-1 \cdot \left(z \cdot \mathsf{fma}\left(t, t\_1, y3 \cdot t\_3\right)\right)\\ \mathbf{elif}\;y4 \leq 2.1 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \left(y \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (- (* a b) (* c i)))
        (t_2
         (*
          y4
          (-
           (fma b (- (* j t) (* k y)) (* y1 (- (* k y2) (* j y3))))
           (* c (- (* t y2) (* y y3))))))
        (t_3 (- (* c y0) (* a y1))))
   (if (<= y4 -1.6e+100)
     t_2
     (if (<= y4 -4e-7)
       (* x (- (fma y t_1 (* y2 t_3)) (* j (- (* b y0) (* i y1)))))
       (if (<= y4 1.5e-136)
         (* -1.0 (* z (fma t t_1 (* y3 t_3))))
         (if (<= y4 2.1e+30) (* x (* y t_1)) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = (a * b) - (c * i);
	double t_2 = y4 * (fma(b, ((j * t) - (k * y)), (y1 * ((k * y2) - (j * y3)))) - (c * ((t * y2) - (y * y3))));
	double t_3 = (c * y0) - (a * y1);
	double tmp;
	if (y4 <= -1.6e+100) {
		tmp = t_2;
	} else if (y4 <= -4e-7) {
		tmp = x * (fma(y, t_1, (y2 * t_3)) - (j * ((b * y0) - (i * y1))));
	} else if (y4 <= 1.5e-136) {
		tmp = -1.0 * (z * fma(t, t_1, (y3 * t_3)));
	} else if (y4 <= 2.1e+30) {
		tmp = x * (y * t_1);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(a * b) - Float64(c * i))
	t_2 = Float64(y4 * Float64(fma(b, Float64(Float64(j * t) - Float64(k * y)), Float64(y1 * Float64(Float64(k * y2) - Float64(j * y3)))) - Float64(c * Float64(Float64(t * y2) - Float64(y * y3)))))
	t_3 = Float64(Float64(c * y0) - Float64(a * y1))
	tmp = 0.0
	if (y4 <= -1.6e+100)
		tmp = t_2;
	elseif (y4 <= -4e-7)
		tmp = Float64(x * Float64(fma(y, t_1, Float64(y2 * t_3)) - Float64(j * Float64(Float64(b * y0) - Float64(i * y1)))));
	elseif (y4 <= 1.5e-136)
		tmp = Float64(-1.0 * Float64(z * fma(t, t_1, Float64(y3 * t_3))));
	elseif (y4 <= 2.1e+30)
		tmp = Float64(x * Float64(y * t_1));
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y4 * N[(N[(b * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision] + N[(y1 * N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(N[(t * y2), $MachinePrecision] - N[(y * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y4, -1.6e+100], t$95$2, If[LessEqual[y4, -4e-7], N[(x * N[(N[(y * t$95$1 + N[(y2 * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(j * N[(N[(b * y0), $MachinePrecision] - N[(i * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, 1.5e-136], N[(-1.0 * N[(z * N[(t * t$95$1 + N[(y3 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, 2.1e+30], N[(x * N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b - c \cdot i\\
t_2 := y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)\\
t_3 := c \cdot y0 - a \cdot y1\\
\mathbf{if}\;y4 \leq -1.6 \cdot 10^{+100}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y4 \leq -4 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(y, t\_1, y2 \cdot t\_3\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\\

\mathbf{elif}\;y4 \leq 1.5 \cdot 10^{-136}:\\
\;\;\;\;-1 \cdot \left(z \cdot \mathsf{fma}\left(t, t\_1, y3 \cdot t\_3\right)\right)\\

\mathbf{elif}\;y4 \leq 2.1 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \left(y \cdot t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y4 < -1.5999999999999999e100 or 2.1e30 < y4

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]

    if -1.5999999999999999e100 < y4 < -3.9999999999999998e-7

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]

    if -3.9999999999999998e-7 < y4 < 1.4999999999999999e-136

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in k around 0

      \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(t \cdot \left(a \cdot b - c \cdot i\right) + \color{blue}{y3 \cdot \left(c \cdot y0 - a \cdot y1\right)}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - \color{blue}{c \cdot i}, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot \color{blue}{i}, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      9. lower-*.f6435.7

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
    7. Applied rewrites35.7%

      \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]

    if 1.4999999999999999e-136 < y4 < 2.1e30

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - \color{blue}{c \cdot i}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot \color{blue}{i}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
      4. lower-*.f6426.3

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 4: 41.4% accurate, 3.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot y0 - a \cdot y1\\ \mathbf{if}\;y2 \leq -6.2 \cdot 10^{+43}:\\ \;\;\;\;y2 \cdot \left(x \cdot t\_1 - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\\ \mathbf{elif}\;y2 \leq -2.9 \cdot 10^{-94}:\\ \;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot t\_1\right)\right)\\ \mathbf{elif}\;y2 \leq -1.46 \cdot 10^{-182}:\\ \;\;\;\;b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right)\\ \mathbf{elif}\;y2 \leq 3.2 \cdot 10^{-282}:\\ \;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot \left(t \cdot y5 - x \cdot y1\right)\right)\right)\\ \mathbf{elif}\;y2 \leq 4.8 \cdot 10^{-30}:\\ \;\;\;\;x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right)\\ \mathbf{elif}\;y2 \leq 2 \cdot 10^{+91}:\\ \;\;\;\;c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (- (* c y0) (* a y1))))
   (if (<= y2 -6.2e+43)
     (* y2 (- (* x t_1) (* t (- (* c y4) (* a y5)))))
     (if (<= y2 -2.9e-94)
       (* -1.0 (* y3 (* z t_1)))
       (if (<= y2 -1.46e-182)
         (* b (* y (fma -1.0 (* k y4) (* a x))))
         (if (<= y2 3.2e-282)
           (* -1.0 (* i (* j (- (* t y5) (* x y1)))))
           (if (<= y2 4.8e-30)
             (* x (* y (- (* a b) (* c i))))
             (if (<= y2 2e+91)
               (* c (* y4 (- (* y y3) (* t y2))))
               (* k (* y2 (- (* y1 y4) (* y0 y5))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = (c * y0) - (a * y1);
	double tmp;
	if (y2 <= -6.2e+43) {
		tmp = y2 * ((x * t_1) - (t * ((c * y4) - (a * y5))));
	} else if (y2 <= -2.9e-94) {
		tmp = -1.0 * (y3 * (z * t_1));
	} else if (y2 <= -1.46e-182) {
		tmp = b * (y * fma(-1.0, (k * y4), (a * x)));
	} else if (y2 <= 3.2e-282) {
		tmp = -1.0 * (i * (j * ((t * y5) - (x * y1))));
	} else if (y2 <= 4.8e-30) {
		tmp = x * (y * ((a * b) - (c * i)));
	} else if (y2 <= 2e+91) {
		tmp = c * (y4 * ((y * y3) - (t * y2)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(c * y0) - Float64(a * y1))
	tmp = 0.0
	if (y2 <= -6.2e+43)
		tmp = Float64(y2 * Float64(Float64(x * t_1) - Float64(t * Float64(Float64(c * y4) - Float64(a * y5)))));
	elseif (y2 <= -2.9e-94)
		tmp = Float64(-1.0 * Float64(y3 * Float64(z * t_1)));
	elseif (y2 <= -1.46e-182)
		tmp = Float64(b * Float64(y * fma(-1.0, Float64(k * y4), Float64(a * x))));
	elseif (y2 <= 3.2e-282)
		tmp = Float64(-1.0 * Float64(i * Float64(j * Float64(Float64(t * y5) - Float64(x * y1)))));
	elseif (y2 <= 4.8e-30)
		tmp = Float64(x * Float64(y * Float64(Float64(a * b) - Float64(c * i))));
	elseif (y2 <= 2e+91)
		tmp = Float64(c * Float64(y4 * Float64(Float64(y * y3) - Float64(t * y2))));
	else
		tmp = Float64(k * Float64(y2 * Float64(Float64(y1 * y4) - Float64(y0 * y5))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y2, -6.2e+43], N[(y2 * N[(N[(x * t$95$1), $MachinePrecision] - N[(t * N[(N[(c * y4), $MachinePrecision] - N[(a * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -2.9e-94], N[(-1.0 * N[(y3 * N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -1.46e-182], N[(b * N[(y * N[(-1.0 * N[(k * y4), $MachinePrecision] + N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 3.2e-282], N[(-1.0 * N[(i * N[(j * N[(N[(t * y5), $MachinePrecision] - N[(x * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 4.8e-30], N[(x * N[(y * N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 2e+91], N[(c * N[(y4 * N[(N[(y * y3), $MachinePrecision] - N[(t * y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(y2 * N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot y0 - a \cdot y1\\
\mathbf{if}\;y2 \leq -6.2 \cdot 10^{+43}:\\
\;\;\;\;y2 \cdot \left(x \cdot t\_1 - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\\

\mathbf{elif}\;y2 \leq -2.9 \cdot 10^{-94}:\\
\;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot t\_1\right)\right)\\

\mathbf{elif}\;y2 \leq -1.46 \cdot 10^{-182}:\\
\;\;\;\;b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right)\\

\mathbf{elif}\;y2 \leq 3.2 \cdot 10^{-282}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot \left(t \cdot y5 - x \cdot y1\right)\right)\right)\\

\mathbf{elif}\;y2 \leq 4.8 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right)\\

\mathbf{elif}\;y2 \leq 2 \cdot 10^{+91}:\\
\;\;\;\;c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if y2 < -6.2000000000000003e43

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around 0

      \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    6. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \color{blue}{\left(c \cdot y4 - a \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(\color{blue}{c \cdot y4} - a \cdot y5\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot \color{blue}{y4} - a \cdot y5\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - \color{blue}{a \cdot y5}\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot \color{blue}{y5}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      9. lower-*.f6434.2

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
    7. Applied rewrites34.2%

      \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]

    if -6.2000000000000003e43 < y2 < -2.89999999999999995e-94

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in y3 around inf

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \color{blue}{\left(c \cdot y0 - a \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - \color{blue}{a \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]

    if -2.89999999999999995e-94 < y2 < -1.46e-182

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y \cdot \color{blue}{\left(-1 \cdot \left(k \cdot y4\right) + a \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y \cdot \left(-1 \cdot \left(k \cdot y4\right) + \color{blue}{a \cdot x}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot \color{blue}{y4}, a \cdot x\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right) \]
      4. lower-*.f6425.8

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right) \]
    7. Applied rewrites25.8%

      \[\leadsto b \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)}\right) \]

    if -1.46e-182 < y2 < 3.19999999999999983e-282

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \color{blue}{\left(t \cdot y5 - x \cdot y1\right)}\right)\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \left(t \cdot y5 - \color{blue}{x \cdot y1}\right)\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \left(t \cdot y5 - x \cdot \color{blue}{y1}\right)\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \left(t \cdot y5 - x \cdot y1\right)\right)\right) \]
      4. lower-*.f6427.4

        \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \left(t \cdot y5 - x \cdot y1\right)\right)\right) \]
    7. Applied rewrites27.4%

      \[\leadsto -1 \cdot \left(i \cdot \left(j \cdot \color{blue}{\left(t \cdot y5 - x \cdot y1\right)}\right)\right) \]

    if 3.19999999999999983e-282 < y2 < 4.7999999999999997e-30

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - \color{blue}{c \cdot i}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot \color{blue}{i}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
      4. lower-*.f6426.3

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]

    if 4.7999999999999997e-30 < y2 < 2.00000000000000016e91

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in c around inf

      \[\leadsto c \cdot \color{blue}{\left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \color{blue}{\left(y \cdot y3 - t \cdot y2\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - \color{blue}{t \cdot y2}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot \color{blue}{y2}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
      5. lower-*.f6427.3

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
    7. Applied rewrites27.3%

      \[\leadsto c \cdot \color{blue}{\left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)} \]

    if 2.00000000000000016e91 < y2

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around inf

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \color{blue}{\left(y1 \cdot y4 - y0 \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - \color{blue}{y0 \cdot y5}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot \color{blue}{y5}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
      5. lower-*.f6426.9

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
    7. Applied rewrites26.9%

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
  3. Recombined 7 regimes into one program.
  4. Add Preprocessing

Alternative 5: 41.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b - c \cdot i\\ t_2 := \left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot t\_1 - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right)\\ \mathbf{if}\;t\_2 \leq \infty:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\mathsf{fma}\left(y, t\_1, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (- (* a b) (* c i)))
        (t_2
         (+
          (-
           (+
            (+
             (-
              (* (- (* x y) (* z t)) t_1)
              (* (- (* x j) (* z k)) (- (* y0 b) (* y1 i))))
             (* (- (* x y2) (* z y3)) (- (* y0 c) (* y1 a))))
            (* (- (* t j) (* y k)) (- (* y4 b) (* y5 i))))
           (* (- (* t y2) (* y y3)) (- (* y4 c) (* y5 a))))
          (* (- (* k y2) (* j y3)) (- (* y4 y1) (* y5 y0))))))
   (if (<= t_2 INFINITY)
     t_2
     (*
      x
      (-
       (fma y t_1 (* y2 (- (* c y0) (* a y1))))
       (* j (- (* b y0) (* i y1))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = (a * b) - (c * i);
	double t_2 = (((((((x * y) - (z * t)) * t_1) - (((x * j) - (z * k)) * ((y0 * b) - (y1 * i)))) + (((x * y2) - (z * y3)) * ((y0 * c) - (y1 * a)))) + (((t * j) - (y * k)) * ((y4 * b) - (y5 * i)))) - (((t * y2) - (y * y3)) * ((y4 * c) - (y5 * a)))) + (((k * y2) - (j * y3)) * ((y4 * y1) - (y5 * y0)));
	double tmp;
	if (t_2 <= ((double) INFINITY)) {
		tmp = t_2;
	} else {
		tmp = x * (fma(y, t_1, (y2 * ((c * y0) - (a * y1)))) - (j * ((b * y0) - (i * y1))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(a * b) - Float64(c * i))
	t_2 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) - Float64(z * t)) * t_1) - Float64(Float64(Float64(x * j) - Float64(z * k)) * Float64(Float64(y0 * b) - Float64(y1 * i)))) + Float64(Float64(Float64(x * y2) - Float64(z * y3)) * Float64(Float64(y0 * c) - Float64(y1 * a)))) + Float64(Float64(Float64(t * j) - Float64(y * k)) * Float64(Float64(y4 * b) - Float64(y5 * i)))) - Float64(Float64(Float64(t * y2) - Float64(y * y3)) * Float64(Float64(y4 * c) - Float64(y5 * a)))) + Float64(Float64(Float64(k * y2) - Float64(j * y3)) * Float64(Float64(y4 * y1) - Float64(y5 * y0))))
	tmp = 0.0
	if (t_2 <= Inf)
		tmp = t_2;
	else
		tmp = Float64(x * Float64(fma(y, t_1, Float64(y2 * Float64(Float64(c * y0) - Float64(a * y1)))) - Float64(j * Float64(Float64(b * y0) - Float64(i * y1)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(N[(N[(x * j), $MachinePrecision] - N[(z * k), $MachinePrecision]), $MachinePrecision] * N[(N[(y0 * b), $MachinePrecision] - N[(y1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * y2), $MachinePrecision] - N[(z * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y0 * c), $MachinePrecision] - N[(y1 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t * j), $MachinePrecision] - N[(y * k), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * b), $MachinePrecision] - N[(y5 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t * y2), $MachinePrecision] - N[(y * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * c), $MachinePrecision] - N[(y5 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision] * N[(N[(y4 * y1), $MachinePrecision] - N[(y5 * y0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], t$95$2, N[(x * N[(N[(y * t$95$1 + N[(y2 * N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(N[(b * y0), $MachinePrecision] - N[(i * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b - c \cdot i\\
t_2 := \left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot t\_1 - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right)\\
\mathbf{if}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\mathsf{fma}\left(y, t\_1, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 (*.f64 x y) (*.f64 z t)) (-.f64 (*.f64 a b) (*.f64 c i))) (*.f64 (-.f64 (*.f64 x j) (*.f64 z k)) (-.f64 (*.f64 y0 b) (*.f64 y1 i)))) (*.f64 (-.f64 (*.f64 x y2) (*.f64 z y3)) (-.f64 (*.f64 y0 c) (*.f64 y1 a)))) (*.f64 (-.f64 (*.f64 t j) (*.f64 y k)) (-.f64 (*.f64 y4 b) (*.f64 y5 i)))) (*.f64 (-.f64 (*.f64 t y2) (*.f64 y y3)) (-.f64 (*.f64 y4 c) (*.f64 y5 a)))) (*.f64 (-.f64 (*.f64 k y2) (*.f64 j y3)) (-.f64 (*.f64 y4 y1) (*.f64 y5 y0)))) < +inf.0

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]

    if +inf.0 < (+.f64 (-.f64 (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 (*.f64 x y) (*.f64 z t)) (-.f64 (*.f64 a b) (*.f64 c i))) (*.f64 (-.f64 (*.f64 x j) (*.f64 z k)) (-.f64 (*.f64 y0 b) (*.f64 y1 i)))) (*.f64 (-.f64 (*.f64 x y2) (*.f64 z y3)) (-.f64 (*.f64 y0 c) (*.f64 y1 a)))) (*.f64 (-.f64 (*.f64 t j) (*.f64 y k)) (-.f64 (*.f64 y4 b) (*.f64 y5 i)))) (*.f64 (-.f64 (*.f64 t y2) (*.f64 y y3)) (-.f64 (*.f64 y4 c) (*.f64 y5 a)))) (*.f64 (-.f64 (*.f64 k y2) (*.f64 j y3)) (-.f64 (*.f64 y4 y1) (*.f64 y5 y0))))

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 39.6% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b - c \cdot i\\ \mathbf{if}\;y \leq -2.8 \cdot 10^{+37}:\\ \;\;\;\;b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right)\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{-294}:\\ \;\;\;\;-1 \cdot \left(z \cdot \mathsf{fma}\left(t, t\_1, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-53}:\\ \;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+122}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+179}:\\ \;\;\;\;y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot t\_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (- (* a b) (* c i))))
   (if (<= y -2.8e+37)
     (* b (* y (fma -1.0 (* k y4) (* a x))))
     (if (<= y -6.4e-294)
       (* -1.0 (* z (fma t t_1 (* y3 (- (* c y0) (* a y1))))))
       (if (<= y 1.5e-53)
         (* y1 (* y4 (- (* k y2) (* j y3))))
         (if (<= y 2.9e+122)
           (* i (* k (- (* y y5) (* y1 z))))
           (if (<= y 4.8e+179)
             (* y4 (* c (- (* y y3) (* t y2))))
             (* x (* y t_1)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = (a * b) - (c * i);
	double tmp;
	if (y <= -2.8e+37) {
		tmp = b * (y * fma(-1.0, (k * y4), (a * x)));
	} else if (y <= -6.4e-294) {
		tmp = -1.0 * (z * fma(t, t_1, (y3 * ((c * y0) - (a * y1)))));
	} else if (y <= 1.5e-53) {
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	} else if (y <= 2.9e+122) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (y <= 4.8e+179) {
		tmp = y4 * (c * ((y * y3) - (t * y2)));
	} else {
		tmp = x * (y * t_1);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(a * b) - Float64(c * i))
	tmp = 0.0
	if (y <= -2.8e+37)
		tmp = Float64(b * Float64(y * fma(-1.0, Float64(k * y4), Float64(a * x))));
	elseif (y <= -6.4e-294)
		tmp = Float64(-1.0 * Float64(z * fma(t, t_1, Float64(y3 * Float64(Float64(c * y0) - Float64(a * y1))))));
	elseif (y <= 1.5e-53)
		tmp = Float64(y1 * Float64(y4 * Float64(Float64(k * y2) - Float64(j * y3))));
	elseif (y <= 2.9e+122)
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	elseif (y <= 4.8e+179)
		tmp = Float64(y4 * Float64(c * Float64(Float64(y * y3) - Float64(t * y2))));
	else
		tmp = Float64(x * Float64(y * t_1));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e+37], N[(b * N[(y * N[(-1.0 * N[(k * y4), $MachinePrecision] + N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.4e-294], N[(-1.0 * N[(z * N[(t * t$95$1 + N[(y3 * N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-53], N[(y1 * N[(y4 * N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+122], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+179], N[(y4 * N[(c * N[(N[(y * y3), $MachinePrecision] - N[(t * y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b - c \cdot i\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+37}:\\
\;\;\;\;b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right)\\

\mathbf{elif}\;y \leq -6.4 \cdot 10^{-294}:\\
\;\;\;\;-1 \cdot \left(z \cdot \mathsf{fma}\left(t, t\_1, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right)\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-53}:\\
\;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+122}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+179}:\\
\;\;\;\;y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -2.7999999999999998e37

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y \cdot \color{blue}{\left(-1 \cdot \left(k \cdot y4\right) + a \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y \cdot \left(-1 \cdot \left(k \cdot y4\right) + \color{blue}{a \cdot x}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot \color{blue}{y4}, a \cdot x\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right) \]
      4. lower-*.f6425.8

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right) \]
    7. Applied rewrites25.8%

      \[\leadsto b \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)}\right) \]

    if -2.7999999999999998e37 < y < -6.40000000000000038e-294

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in k around 0

      \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(t \cdot \left(a \cdot b - c \cdot i\right) + \color{blue}{y3 \cdot \left(c \cdot y0 - a \cdot y1\right)}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - \color{blue}{c \cdot i}, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot \color{blue}{i}, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      9. lower-*.f6435.7

        \[\leadsto -1 \cdot \left(z \cdot \mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
    7. Applied rewrites35.7%

      \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]

    if -6.40000000000000038e-294 < y < 1.5000000000000001e-53

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in y1 around inf

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \color{blue}{\left(k \cdot y2 - j \cdot y3\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - \color{blue}{j \cdot y3}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot \color{blue}{y3}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
      5. lower-*.f6426.4

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]

    if 1.5000000000000001e-53 < y < 2.9000000000000001e122

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]

    if 2.9000000000000001e122 < y < 4.80000000000000025e179

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in c around inf

      \[\leadsto y4 \cdot \left(c \cdot \color{blue}{\left(y \cdot y3 - t \cdot y2\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \left(c \cdot \left(y \cdot y3 - \color{blue}{t \cdot y2}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot \color{blue}{y2}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
      4. lower-*.f6427.0

        \[\leadsto y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
    7. Applied rewrites27.0%

      \[\leadsto y4 \cdot \left(c \cdot \color{blue}{\left(y \cdot y3 - t \cdot y2\right)}\right) \]

    if 4.80000000000000025e179 < y

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - \color{blue}{c \cdot i}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot \color{blue}{i}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
      4. lower-*.f6426.3

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
  3. Recombined 6 regimes into one program.
  4. Add Preprocessing

Alternative 7: 34.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot y0 - a \cdot y1\\ t_2 := x \cdot t\_1\\ t_3 := t \cdot \left(c \cdot y4 - a \cdot y5\right)\\ \mathbf{if}\;y2 \leq -6.2 \cdot 10^{+43}:\\ \;\;\;\;y2 \cdot \left(t\_2 - t\_3\right)\\ \mathbf{elif}\;y2 \leq -1.45 \cdot 10^{-93}:\\ \;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot t\_1\right)\right)\\ \mathbf{elif}\;y2 \leq 3.1 \cdot 10^{+127}:\\ \;\;\;\;b \cdot \left(\mathsf{fma}\left(a, x \cdot y - t \cdot z, y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, t\_2\right) - t\_3\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (- (* c y0) (* a y1)))
        (t_2 (* x t_1))
        (t_3 (* t (- (* c y4) (* a y5)))))
   (if (<= y2 -6.2e+43)
     (* y2 (- t_2 t_3))
     (if (<= y2 -1.45e-93)
       (* -1.0 (* y3 (* z t_1)))
       (if (<= y2 3.1e+127)
         (*
          b
          (-
           (fma a (- (* x y) (* t z)) (* y4 (- (* j t) (* k y))))
           (* y0 (- (* j x) (* k z)))))
         (* y2 (- (fma k (- (* y1 y4) (* y0 y5)) t_2) t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = (c * y0) - (a * y1);
	double t_2 = x * t_1;
	double t_3 = t * ((c * y4) - (a * y5));
	double tmp;
	if (y2 <= -6.2e+43) {
		tmp = y2 * (t_2 - t_3);
	} else if (y2 <= -1.45e-93) {
		tmp = -1.0 * (y3 * (z * t_1));
	} else if (y2 <= 3.1e+127) {
		tmp = b * (fma(a, ((x * y) - (t * z)), (y4 * ((j * t) - (k * y)))) - (y0 * ((j * x) - (k * z))));
	} else {
		tmp = y2 * (fma(k, ((y1 * y4) - (y0 * y5)), t_2) - t_3);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(c * y0) - Float64(a * y1))
	t_2 = Float64(x * t_1)
	t_3 = Float64(t * Float64(Float64(c * y4) - Float64(a * y5)))
	tmp = 0.0
	if (y2 <= -6.2e+43)
		tmp = Float64(y2 * Float64(t_2 - t_3));
	elseif (y2 <= -1.45e-93)
		tmp = Float64(-1.0 * Float64(y3 * Float64(z * t_1)));
	elseif (y2 <= 3.1e+127)
		tmp = Float64(b * Float64(fma(a, Float64(Float64(x * y) - Float64(t * z)), Float64(y4 * Float64(Float64(j * t) - Float64(k * y)))) - Float64(y0 * Float64(Float64(j * x) - Float64(k * z)))));
	else
		tmp = Float64(y2 * Float64(fma(k, Float64(Float64(y1 * y4) - Float64(y0 * y5)), t_2) - t_3));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(c * y4), $MachinePrecision] - N[(a * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y2, -6.2e+43], N[(y2 * N[(t$95$2 - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -1.45e-93], N[(-1.0 * N[(y3 * N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 3.1e+127], N[(b * N[(N[(a * N[(N[(x * y), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(y4 * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y0 * N[(N[(j * x), $MachinePrecision] - N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y2 * N[(N[(k * N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot y0 - a \cdot y1\\
t_2 := x \cdot t\_1\\
t_3 := t \cdot \left(c \cdot y4 - a \cdot y5\right)\\
\mathbf{if}\;y2 \leq -6.2 \cdot 10^{+43}:\\
\;\;\;\;y2 \cdot \left(t\_2 - t\_3\right)\\

\mathbf{elif}\;y2 \leq -1.45 \cdot 10^{-93}:\\
\;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot t\_1\right)\right)\\

\mathbf{elif}\;y2 \leq 3.1 \cdot 10^{+127}:\\
\;\;\;\;b \cdot \left(\mathsf{fma}\left(a, x \cdot y - t \cdot z, y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, t\_2\right) - t\_3\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y2 < -6.2000000000000003e43

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around 0

      \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    6. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \color{blue}{\left(c \cdot y4 - a \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(\color{blue}{c \cdot y4} - a \cdot y5\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot \color{blue}{y4} - a \cdot y5\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - \color{blue}{a \cdot y5}\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot \color{blue}{y5}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      9. lower-*.f6434.2

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
    7. Applied rewrites34.2%

      \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]

    if -6.2000000000000003e43 < y2 < -1.4499999999999999e-93

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in y3 around inf

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \color{blue}{\left(c \cdot y0 - a \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - \color{blue}{a \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]

    if -1.4499999999999999e-93 < y2 < 3.1000000000000002e127

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{b \cdot \left(\mathsf{fma}\left(a, x \cdot y - t \cdot z, y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]

    if 3.1000000000000002e127 < y2

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 8: 33.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot y0 - a \cdot y1\\ \mathbf{if}\;y2 \leq -6.2 \cdot 10^{+43}:\\ \;\;\;\;y2 \cdot \left(x \cdot t\_1 - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\\ \mathbf{elif}\;y2 \leq -1.45 \cdot 10^{-93}:\\ \;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot t\_1\right)\right)\\ \mathbf{elif}\;y2 \leq 1.55 \cdot 10^{+124}:\\ \;\;\;\;b \cdot \left(\mathsf{fma}\left(a, x \cdot y - t \cdot z, y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (- (* c y0) (* a y1))))
   (if (<= y2 -6.2e+43)
     (* y2 (- (* x t_1) (* t (- (* c y4) (* a y5)))))
     (if (<= y2 -1.45e-93)
       (* -1.0 (* y3 (* z t_1)))
       (if (<= y2 1.55e+124)
         (*
          b
          (-
           (fma a (- (* x y) (* t z)) (* y4 (- (* j t) (* k y))))
           (* y0 (- (* j x) (* k z)))))
         (* k (* y2 (- (* y1 y4) (* y0 y5)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = (c * y0) - (a * y1);
	double tmp;
	if (y2 <= -6.2e+43) {
		tmp = y2 * ((x * t_1) - (t * ((c * y4) - (a * y5))));
	} else if (y2 <= -1.45e-93) {
		tmp = -1.0 * (y3 * (z * t_1));
	} else if (y2 <= 1.55e+124) {
		tmp = b * (fma(a, ((x * y) - (t * z)), (y4 * ((j * t) - (k * y)))) - (y0 * ((j * x) - (k * z))));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(c * y0) - Float64(a * y1))
	tmp = 0.0
	if (y2 <= -6.2e+43)
		tmp = Float64(y2 * Float64(Float64(x * t_1) - Float64(t * Float64(Float64(c * y4) - Float64(a * y5)))));
	elseif (y2 <= -1.45e-93)
		tmp = Float64(-1.0 * Float64(y3 * Float64(z * t_1)));
	elseif (y2 <= 1.55e+124)
		tmp = Float64(b * Float64(fma(a, Float64(Float64(x * y) - Float64(t * z)), Float64(y4 * Float64(Float64(j * t) - Float64(k * y)))) - Float64(y0 * Float64(Float64(j * x) - Float64(k * z)))));
	else
		tmp = Float64(k * Float64(y2 * Float64(Float64(y1 * y4) - Float64(y0 * y5))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y2, -6.2e+43], N[(y2 * N[(N[(x * t$95$1), $MachinePrecision] - N[(t * N[(N[(c * y4), $MachinePrecision] - N[(a * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -1.45e-93], N[(-1.0 * N[(y3 * N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 1.55e+124], N[(b * N[(N[(a * N[(N[(x * y), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(y4 * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y0 * N[(N[(j * x), $MachinePrecision] - N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(y2 * N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot y0 - a \cdot y1\\
\mathbf{if}\;y2 \leq -6.2 \cdot 10^{+43}:\\
\;\;\;\;y2 \cdot \left(x \cdot t\_1 - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)\\

\mathbf{elif}\;y2 \leq -1.45 \cdot 10^{-93}:\\
\;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot t\_1\right)\right)\\

\mathbf{elif}\;y2 \leq 1.55 \cdot 10^{+124}:\\
\;\;\;\;b \cdot \left(\mathsf{fma}\left(a, x \cdot y - t \cdot z, y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y2 < -6.2000000000000003e43

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around 0

      \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    6. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \color{blue}{\left(c \cdot y4 - a \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(\color{blue}{c \cdot y4} - a \cdot y5\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot \color{blue}{y4} - a \cdot y5\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - \color{blue}{a \cdot y5}\right)\right) \]
      7. lower--.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot \color{blue}{y5}\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
      9. lower-*.f6434.2

        \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right) \]
    7. Applied rewrites34.2%

      \[\leadsto y2 \cdot \left(x \cdot \left(c \cdot y0 - a \cdot y1\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]

    if -6.2000000000000003e43 < y2 < -1.4499999999999999e-93

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in y3 around inf

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \color{blue}{\left(c \cdot y0 - a \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - \color{blue}{a \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]

    if -1.4499999999999999e-93 < y2 < 1.5500000000000001e124

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{b \cdot \left(\mathsf{fma}\left(a, x \cdot y - t \cdot z, y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]

    if 1.5500000000000001e124 < y2

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around inf

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \color{blue}{\left(y1 \cdot y4 - y0 \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - \color{blue}{y0 \cdot y5}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot \color{blue}{y5}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
      5. lower-*.f6426.9

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
    7. Applied rewrites26.9%

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 9: 33.1% accurate, 3.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -15500000000:\\ \;\;\;\;b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right)\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-292}:\\ \;\;\;\;a \cdot \left(z \cdot \mathsf{fma}\left(-1, b \cdot t, y1 \cdot y3\right)\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-53}:\\ \;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+122}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+179}:\\ \;\;\;\;y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= y -15500000000.0)
   (* b (* y (fma -1.0 (* k y4) (* a x))))
   (if (<= y -5.4e-292)
     (* a (* z (fma -1.0 (* b t) (* y1 y3))))
     (if (<= y 1.5e-53)
       (* y1 (* y4 (- (* k y2) (* j y3))))
       (if (<= y 2.9e+122)
         (* i (* k (- (* y y5) (* y1 z))))
         (if (<= y 4.8e+179)
           (* y4 (* c (- (* y y3) (* t y2))))
           (* x (* y (- (* a b) (* c i))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y <= -15500000000.0) {
		tmp = b * (y * fma(-1.0, (k * y4), (a * x)));
	} else if (y <= -5.4e-292) {
		tmp = a * (z * fma(-1.0, (b * t), (y1 * y3)));
	} else if (y <= 1.5e-53) {
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	} else if (y <= 2.9e+122) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (y <= 4.8e+179) {
		tmp = y4 * (c * ((y * y3) - (t * y2)));
	} else {
		tmp = x * (y * ((a * b) - (c * i)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (y <= -15500000000.0)
		tmp = Float64(b * Float64(y * fma(-1.0, Float64(k * y4), Float64(a * x))));
	elseif (y <= -5.4e-292)
		tmp = Float64(a * Float64(z * fma(-1.0, Float64(b * t), Float64(y1 * y3))));
	elseif (y <= 1.5e-53)
		tmp = Float64(y1 * Float64(y4 * Float64(Float64(k * y2) - Float64(j * y3))));
	elseif (y <= 2.9e+122)
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	elseif (y <= 4.8e+179)
		tmp = Float64(y4 * Float64(c * Float64(Float64(y * y3) - Float64(t * y2))));
	else
		tmp = Float64(x * Float64(y * Float64(Float64(a * b) - Float64(c * i))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[y, -15500000000.0], N[(b * N[(y * N[(-1.0 * N[(k * y4), $MachinePrecision] + N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.4e-292], N[(a * N[(z * N[(-1.0 * N[(b * t), $MachinePrecision] + N[(y1 * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-53], N[(y1 * N[(y4 * N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+122], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+179], N[(y4 * N[(c * N[(N[(y * y3), $MachinePrecision] - N[(t * y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(N[(a * b), $MachinePrecision] - N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -15500000000:\\
\;\;\;\;b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right)\\

\mathbf{elif}\;y \leq -5.4 \cdot 10^{-292}:\\
\;\;\;\;a \cdot \left(z \cdot \mathsf{fma}\left(-1, b \cdot t, y1 \cdot y3\right)\right)\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-53}:\\
\;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+122}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+179}:\\
\;\;\;\;y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.55e10

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y \cdot \color{blue}{\left(-1 \cdot \left(k \cdot y4\right) + a \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y \cdot \left(-1 \cdot \left(k \cdot y4\right) + \color{blue}{a \cdot x}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot \color{blue}{y4}, a \cdot x\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right) \]
      4. lower-*.f6425.8

        \[\leadsto b \cdot \left(y \cdot \mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)\right) \]
    7. Applied rewrites25.8%

      \[\leadsto b \cdot \left(y \cdot \color{blue}{\mathsf{fma}\left(-1, k \cdot y4, a \cdot x\right)}\right) \]

    if -1.55e10 < y < -5.3999999999999998e-292

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in a around -inf

      \[\leadsto a \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \left(b \cdot t\right) + y1 \cdot y3\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto a \cdot \left(z \cdot \mathsf{fma}\left(-1, b \cdot \color{blue}{t}, y1 \cdot y3\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto a \cdot \left(z \cdot \mathsf{fma}\left(-1, b \cdot t, y1 \cdot y3\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto a \cdot \left(z \cdot \mathsf{fma}\left(-1, b \cdot t, y1 \cdot y3\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto a \cdot \color{blue}{\left(z \cdot \mathsf{fma}\left(-1, b \cdot t, y1 \cdot y3\right)\right)} \]

    if -5.3999999999999998e-292 < y < 1.5000000000000001e-53

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in y1 around inf

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \color{blue}{\left(k \cdot y2 - j \cdot y3\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - \color{blue}{j \cdot y3}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot \color{blue}{y3}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
      5. lower-*.f6426.4

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]

    if 1.5000000000000001e-53 < y < 2.9000000000000001e122

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]

    if 2.9000000000000001e122 < y < 4.80000000000000025e179

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in c around inf

      \[\leadsto y4 \cdot \left(c \cdot \color{blue}{\left(y \cdot y3 - t \cdot y2\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \left(c \cdot \left(y \cdot y3 - \color{blue}{t \cdot y2}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot \color{blue}{y2}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
      4. lower-*.f6427.0

        \[\leadsto y4 \cdot \left(c \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
    7. Applied rewrites27.0%

      \[\leadsto y4 \cdot \left(c \cdot \color{blue}{\left(y \cdot y3 - t \cdot y2\right)}\right) \]

    if 4.80000000000000025e179 < y

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - \color{blue}{c \cdot i}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot \color{blue}{i}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
      4. lower-*.f6426.3

        \[\leadsto x \cdot \left(y \cdot \left(a \cdot b - c \cdot i\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto x \cdot \left(y \cdot \color{blue}{\left(a \cdot b - c \cdot i\right)}\right) \]
  3. Recombined 6 regimes into one program.
  4. Add Preprocessing

Alternative 10: 32.9% accurate, 3.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y2 \leq -1.2 \cdot 10^{+44}:\\ \;\;\;\;t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)\\ \mathbf{elif}\;y2 \leq -3.4 \cdot 10^{-14}:\\ \;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\ \mathbf{elif}\;y2 \leq -8 \cdot 10^{-200}:\\ \;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\ \mathbf{elif}\;y2 \leq 1.8 \cdot 10^{-181}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \mathbf{elif}\;y2 \leq 3.35 \cdot 10^{-31}:\\ \;\;\;\;b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot y0\right)\right)\right)\\ \mathbf{elif}\;y2 \leq 2 \cdot 10^{+91}:\\ \;\;\;\;c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= y2 -1.2e+44)
   (* t (* y2 (- (* a y5) (* c y4))))
   (if (<= y2 -3.4e-14)
     (* y1 (* y4 (- (* k y2) (* j y3))))
     (if (<= y2 -8e-200)
       (* i (* z (- (* c t) (* k y1))))
       (if (<= y2 1.8e-181)
         (* i (* k (- (* y y5) (* y1 z))))
         (if (<= y2 3.35e-31)
           (* b (* -1.0 (* j (* x y0))))
           (if (<= y2 2e+91)
             (* c (* y4 (- (* y y3) (* t y2))))
             (* k (* y2 (- (* y1 y4) (* y0 y5)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y2 <= -1.2e+44) {
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	} else if (y2 <= -3.4e-14) {
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	} else if (y2 <= -8e-200) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y2 <= 1.8e-181) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (y2 <= 3.35e-31) {
		tmp = b * (-1.0 * (j * (x * y0)));
	} else if (y2 <= 2e+91) {
		tmp = c * (y4 * ((y * y3) - (t * y2)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (y2 <= (-1.2d+44)) then
        tmp = t * (y2 * ((a * y5) - (c * y4)))
    else if (y2 <= (-3.4d-14)) then
        tmp = y1 * (y4 * ((k * y2) - (j * y3)))
    else if (y2 <= (-8d-200)) then
        tmp = i * (z * ((c * t) - (k * y1)))
    else if (y2 <= 1.8d-181) then
        tmp = i * (k * ((y * y5) - (y1 * z)))
    else if (y2 <= 3.35d-31) then
        tmp = b * ((-1.0d0) * (j * (x * y0)))
    else if (y2 <= 2d+91) then
        tmp = c * (y4 * ((y * y3) - (t * y2)))
    else
        tmp = k * (y2 * ((y1 * y4) - (y0 * y5)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y2 <= -1.2e+44) {
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	} else if (y2 <= -3.4e-14) {
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	} else if (y2 <= -8e-200) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y2 <= 1.8e-181) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (y2 <= 3.35e-31) {
		tmp = b * (-1.0 * (j * (x * y0)));
	} else if (y2 <= 2e+91) {
		tmp = c * (y4 * ((y * y3) - (t * y2)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if y2 <= -1.2e+44:
		tmp = t * (y2 * ((a * y5) - (c * y4)))
	elif y2 <= -3.4e-14:
		tmp = y1 * (y4 * ((k * y2) - (j * y3)))
	elif y2 <= -8e-200:
		tmp = i * (z * ((c * t) - (k * y1)))
	elif y2 <= 1.8e-181:
		tmp = i * (k * ((y * y5) - (y1 * z)))
	elif y2 <= 3.35e-31:
		tmp = b * (-1.0 * (j * (x * y0)))
	elif y2 <= 2e+91:
		tmp = c * (y4 * ((y * y3) - (t * y2)))
	else:
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (y2 <= -1.2e+44)
		tmp = Float64(t * Float64(y2 * Float64(Float64(a * y5) - Float64(c * y4))));
	elseif (y2 <= -3.4e-14)
		tmp = Float64(y1 * Float64(y4 * Float64(Float64(k * y2) - Float64(j * y3))));
	elseif (y2 <= -8e-200)
		tmp = Float64(i * Float64(z * Float64(Float64(c * t) - Float64(k * y1))));
	elseif (y2 <= 1.8e-181)
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	elseif (y2 <= 3.35e-31)
		tmp = Float64(b * Float64(-1.0 * Float64(j * Float64(x * y0))));
	elseif (y2 <= 2e+91)
		tmp = Float64(c * Float64(y4 * Float64(Float64(y * y3) - Float64(t * y2))));
	else
		tmp = Float64(k * Float64(y2 * Float64(Float64(y1 * y4) - Float64(y0 * y5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (y2 <= -1.2e+44)
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	elseif (y2 <= -3.4e-14)
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	elseif (y2 <= -8e-200)
		tmp = i * (z * ((c * t) - (k * y1)));
	elseif (y2 <= 1.8e-181)
		tmp = i * (k * ((y * y5) - (y1 * z)));
	elseif (y2 <= 3.35e-31)
		tmp = b * (-1.0 * (j * (x * y0)));
	elseif (y2 <= 2e+91)
		tmp = c * (y4 * ((y * y3) - (t * y2)));
	else
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[y2, -1.2e+44], N[(t * N[(y2 * N[(N[(a * y5), $MachinePrecision] - N[(c * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -3.4e-14], N[(y1 * N[(y4 * N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -8e-200], N[(i * N[(z * N[(N[(c * t), $MachinePrecision] - N[(k * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 1.8e-181], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 3.35e-31], N[(b * N[(-1.0 * N[(j * N[(x * y0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 2e+91], N[(c * N[(y4 * N[(N[(y * y3), $MachinePrecision] - N[(t * y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(y2 * N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y2 \leq -1.2 \cdot 10^{+44}:\\
\;\;\;\;t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)\\

\mathbf{elif}\;y2 \leq -3.4 \cdot 10^{-14}:\\
\;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\

\mathbf{elif}\;y2 \leq -8 \cdot 10^{-200}:\\
\;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\

\mathbf{elif}\;y2 \leq 1.8 \cdot 10^{-181}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\

\mathbf{elif}\;y2 \leq 3.35 \cdot 10^{-31}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot y0\right)\right)\right)\\

\mathbf{elif}\;y2 \leq 2 \cdot 10^{+91}:\\
\;\;\;\;c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if y2 < -1.20000000000000007e44

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in t around inf

      \[\leadsto t \cdot \color{blue}{\left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \color{blue}{\left(a \cdot y5 - c \cdot y4\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - \color{blue}{c \cdot y4}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot \color{blue}{y4}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right) \]
      5. lower-*.f6427.1

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right) \]
    7. Applied rewrites27.1%

      \[\leadsto t \cdot \color{blue}{\left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)} \]

    if -1.20000000000000007e44 < y2 < -3.40000000000000003e-14

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in y1 around inf

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \color{blue}{\left(k \cdot y2 - j \cdot y3\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - \color{blue}{j \cdot y3}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot \color{blue}{y3}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
      5. lower-*.f6426.4

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]

    if -3.40000000000000003e-14 < y2 < -7.9999999999999999e-200

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in z around -inf

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \color{blue}{\left(c \cdot t - k \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - \color{blue}{k \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
      5. lower-*.f6426.3

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]

    if -7.9999999999999999e-200 < y2 < 1.8e-181

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]

    if 1.8e-181 < y2 < 3.35000000000000002e-31

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - \color{blue}{j \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
      4. lower-*.f6426.5

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    8. Taylor expanded in x around inf

      \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \color{blue}{\left(x \cdot y0\right)}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot \color{blue}{y0}\right)\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot y0\right)\right)\right) \]
      3. lower-*.f6417.3

        \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot y0\right)\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \color{blue}{\left(x \cdot y0\right)}\right)\right) \]

    if 3.35000000000000002e-31 < y2 < 2.00000000000000016e91

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in c around inf

      \[\leadsto c \cdot \color{blue}{\left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \color{blue}{\left(y \cdot y3 - t \cdot y2\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - \color{blue}{t \cdot y2}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot \color{blue}{y2}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
      5. lower-*.f6427.3

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
    7. Applied rewrites27.3%

      \[\leadsto c \cdot \color{blue}{\left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)} \]

    if 2.00000000000000016e91 < y2

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around inf

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \color{blue}{\left(y1 \cdot y4 - y0 \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - \color{blue}{y0 \cdot y5}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot \color{blue}{y5}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
      5. lower-*.f6426.9

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
    7. Applied rewrites26.9%

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
  3. Recombined 7 regimes into one program.
  4. Add Preprocessing

Alternative 11: 32.8% accurate, 3.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y2 \leq -3.9 \cdot 10^{+40}:\\ \;\;\;\;t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)\\ \mathbf{elif}\;y2 \leq -7 \cdot 10^{-71}:\\ \;\;\;\;j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right)\\ \mathbf{elif}\;y2 \leq -7.5 \cdot 10^{-200}:\\ \;\;\;\;b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\ \mathbf{elif}\;y2 \leq 1.8 \cdot 10^{-181}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \mathbf{elif}\;y2 \leq 3.35 \cdot 10^{-31}:\\ \;\;\;\;b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot y0\right)\right)\right)\\ \mathbf{elif}\;y2 \leq 2 \cdot 10^{+91}:\\ \;\;\;\;c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= y2 -3.9e+40)
   (* t (* y2 (- (* a y5) (* c y4))))
   (if (<= y2 -7e-71)
     (* j (* y0 (- (* y3 y5) (* b x))))
     (if (<= y2 -7.5e-200)
       (* b (* y4 (- (* j t) (* k y))))
       (if (<= y2 1.8e-181)
         (* i (* k (- (* y y5) (* y1 z))))
         (if (<= y2 3.35e-31)
           (* b (* -1.0 (* j (* x y0))))
           (if (<= y2 2e+91)
             (* c (* y4 (- (* y y3) (* t y2))))
             (* k (* y2 (- (* y1 y4) (* y0 y5)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y2 <= -3.9e+40) {
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	} else if (y2 <= -7e-71) {
		tmp = j * (y0 * ((y3 * y5) - (b * x)));
	} else if (y2 <= -7.5e-200) {
		tmp = b * (y4 * ((j * t) - (k * y)));
	} else if (y2 <= 1.8e-181) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (y2 <= 3.35e-31) {
		tmp = b * (-1.0 * (j * (x * y0)));
	} else if (y2 <= 2e+91) {
		tmp = c * (y4 * ((y * y3) - (t * y2)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (y2 <= (-3.9d+40)) then
        tmp = t * (y2 * ((a * y5) - (c * y4)))
    else if (y2 <= (-7d-71)) then
        tmp = j * (y0 * ((y3 * y5) - (b * x)))
    else if (y2 <= (-7.5d-200)) then
        tmp = b * (y4 * ((j * t) - (k * y)))
    else if (y2 <= 1.8d-181) then
        tmp = i * (k * ((y * y5) - (y1 * z)))
    else if (y2 <= 3.35d-31) then
        tmp = b * ((-1.0d0) * (j * (x * y0)))
    else if (y2 <= 2d+91) then
        tmp = c * (y4 * ((y * y3) - (t * y2)))
    else
        tmp = k * (y2 * ((y1 * y4) - (y0 * y5)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y2 <= -3.9e+40) {
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	} else if (y2 <= -7e-71) {
		tmp = j * (y0 * ((y3 * y5) - (b * x)));
	} else if (y2 <= -7.5e-200) {
		tmp = b * (y4 * ((j * t) - (k * y)));
	} else if (y2 <= 1.8e-181) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (y2 <= 3.35e-31) {
		tmp = b * (-1.0 * (j * (x * y0)));
	} else if (y2 <= 2e+91) {
		tmp = c * (y4 * ((y * y3) - (t * y2)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if y2 <= -3.9e+40:
		tmp = t * (y2 * ((a * y5) - (c * y4)))
	elif y2 <= -7e-71:
		tmp = j * (y0 * ((y3 * y5) - (b * x)))
	elif y2 <= -7.5e-200:
		tmp = b * (y4 * ((j * t) - (k * y)))
	elif y2 <= 1.8e-181:
		tmp = i * (k * ((y * y5) - (y1 * z)))
	elif y2 <= 3.35e-31:
		tmp = b * (-1.0 * (j * (x * y0)))
	elif y2 <= 2e+91:
		tmp = c * (y4 * ((y * y3) - (t * y2)))
	else:
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (y2 <= -3.9e+40)
		tmp = Float64(t * Float64(y2 * Float64(Float64(a * y5) - Float64(c * y4))));
	elseif (y2 <= -7e-71)
		tmp = Float64(j * Float64(y0 * Float64(Float64(y3 * y5) - Float64(b * x))));
	elseif (y2 <= -7.5e-200)
		tmp = Float64(b * Float64(y4 * Float64(Float64(j * t) - Float64(k * y))));
	elseif (y2 <= 1.8e-181)
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	elseif (y2 <= 3.35e-31)
		tmp = Float64(b * Float64(-1.0 * Float64(j * Float64(x * y0))));
	elseif (y2 <= 2e+91)
		tmp = Float64(c * Float64(y4 * Float64(Float64(y * y3) - Float64(t * y2))));
	else
		tmp = Float64(k * Float64(y2 * Float64(Float64(y1 * y4) - Float64(y0 * y5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (y2 <= -3.9e+40)
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	elseif (y2 <= -7e-71)
		tmp = j * (y0 * ((y3 * y5) - (b * x)));
	elseif (y2 <= -7.5e-200)
		tmp = b * (y4 * ((j * t) - (k * y)));
	elseif (y2 <= 1.8e-181)
		tmp = i * (k * ((y * y5) - (y1 * z)));
	elseif (y2 <= 3.35e-31)
		tmp = b * (-1.0 * (j * (x * y0)));
	elseif (y2 <= 2e+91)
		tmp = c * (y4 * ((y * y3) - (t * y2)));
	else
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[y2, -3.9e+40], N[(t * N[(y2 * N[(N[(a * y5), $MachinePrecision] - N[(c * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -7e-71], N[(j * N[(y0 * N[(N[(y3 * y5), $MachinePrecision] - N[(b * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -7.5e-200], N[(b * N[(y4 * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 1.8e-181], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 3.35e-31], N[(b * N[(-1.0 * N[(j * N[(x * y0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 2e+91], N[(c * N[(y4 * N[(N[(y * y3), $MachinePrecision] - N[(t * y2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(y2 * N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y2 \leq -3.9 \cdot 10^{+40}:\\
\;\;\;\;t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)\\

\mathbf{elif}\;y2 \leq -7 \cdot 10^{-71}:\\
\;\;\;\;j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right)\\

\mathbf{elif}\;y2 \leq -7.5 \cdot 10^{-200}:\\
\;\;\;\;b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\

\mathbf{elif}\;y2 \leq 1.8 \cdot 10^{-181}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\

\mathbf{elif}\;y2 \leq 3.35 \cdot 10^{-31}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot y0\right)\right)\right)\\

\mathbf{elif}\;y2 \leq 2 \cdot 10^{+91}:\\
\;\;\;\;c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if y2 < -3.9000000000000001e40

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in t around inf

      \[\leadsto t \cdot \color{blue}{\left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \color{blue}{\left(a \cdot y5 - c \cdot y4\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - \color{blue}{c \cdot y4}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot \color{blue}{y4}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right) \]
      5. lower-*.f6427.1

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right) \]
    7. Applied rewrites27.1%

      \[\leadsto t \cdot \color{blue}{\left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)} \]

    if -3.9000000000000001e40 < y2 < -6.9999999999999998e-71

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y0 around inf

      \[\leadsto \color{blue}{y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \color{blue}{\left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - \color{blue}{b \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot \left(k \cdot y2 - j \cdot y3\right), c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto j \cdot \color{blue}{\left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto j \cdot \left(y0 \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto j \cdot \left(y0 \cdot \left(y3 \cdot y5 - \color{blue}{b \cdot x}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot \color{blue}{x}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
      5. lower-*.f6428.0

        \[\leadsto j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
    7. Applied rewrites28.0%

      \[\leadsto j \cdot \color{blue}{\left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right)} \]

    if -6.9999999999999998e-71 < y2 < -7.49999999999999958e-200

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \color{blue}{\left(j \cdot t - k \cdot y\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - \color{blue}{k \cdot y}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot \color{blue}{y}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
      5. lower-*.f6425.9

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
    7. Applied rewrites25.9%

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]

    if -7.49999999999999958e-200 < y2 < 1.8e-181

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]

    if 1.8e-181 < y2 < 3.35000000000000002e-31

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - \color{blue}{j \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
      4. lower-*.f6426.5

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    8. Taylor expanded in x around inf

      \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \color{blue}{\left(x \cdot y0\right)}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot \color{blue}{y0}\right)\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot y0\right)\right)\right) \]
      3. lower-*.f6417.3

        \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \left(x \cdot y0\right)\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto b \cdot \left(-1 \cdot \left(j \cdot \color{blue}{\left(x \cdot y0\right)}\right)\right) \]

    if 3.35000000000000002e-31 < y2 < 2.00000000000000016e91

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in c around inf

      \[\leadsto c \cdot \color{blue}{\left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \color{blue}{\left(y \cdot y3 - t \cdot y2\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - \color{blue}{t \cdot y2}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot \color{blue}{y2}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
      5. lower-*.f6427.3

        \[\leadsto c \cdot \left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right) \]
    7. Applied rewrites27.3%

      \[\leadsto c \cdot \color{blue}{\left(y4 \cdot \left(y \cdot y3 - t \cdot y2\right)\right)} \]

    if 2.00000000000000016e91 < y2

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around inf

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \color{blue}{\left(y1 \cdot y4 - y0 \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - \color{blue}{y0 \cdot y5}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot \color{blue}{y5}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
      5. lower-*.f6426.9

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
    7. Applied rewrites26.9%

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
  3. Recombined 7 regimes into one program.
  4. Add Preprocessing

Alternative 12: 32.2% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y4 \leq -4.8 \cdot 10^{+85}:\\ \;\;\;\;y2 \cdot \left(y4 \cdot \left(k \cdot y1 - c \cdot t\right)\right)\\ \mathbf{elif}\;y4 \leq -8.8 \cdot 10^{-90}:\\ \;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\ \mathbf{elif}\;y4 \leq 1.5 \cdot 10^{+100}:\\ \;\;\;\;b \cdot \left(a \cdot \left(x \cdot y - t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= y4 -4.8e+85)
   (* y2 (* y4 (- (* k y1) (* c t))))
   (if (<= y4 -8.8e-90)
     (* i (* z (- (* c t) (* k y1))))
     (if (<= y4 1.5e+100)
       (* b (* a (- (* x y) (* t z))))
       (* y1 (* y4 (- (* k y2) (* j y3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y4 <= -4.8e+85) {
		tmp = y2 * (y4 * ((k * y1) - (c * t)));
	} else if (y4 <= -8.8e-90) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y4 <= 1.5e+100) {
		tmp = b * (a * ((x * y) - (t * z)));
	} else {
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (y4 <= (-4.8d+85)) then
        tmp = y2 * (y4 * ((k * y1) - (c * t)))
    else if (y4 <= (-8.8d-90)) then
        tmp = i * (z * ((c * t) - (k * y1)))
    else if (y4 <= 1.5d+100) then
        tmp = b * (a * ((x * y) - (t * z)))
    else
        tmp = y1 * (y4 * ((k * y2) - (j * y3)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y4 <= -4.8e+85) {
		tmp = y2 * (y4 * ((k * y1) - (c * t)));
	} else if (y4 <= -8.8e-90) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y4 <= 1.5e+100) {
		tmp = b * (a * ((x * y) - (t * z)));
	} else {
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if y4 <= -4.8e+85:
		tmp = y2 * (y4 * ((k * y1) - (c * t)))
	elif y4 <= -8.8e-90:
		tmp = i * (z * ((c * t) - (k * y1)))
	elif y4 <= 1.5e+100:
		tmp = b * (a * ((x * y) - (t * z)))
	else:
		tmp = y1 * (y4 * ((k * y2) - (j * y3)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (y4 <= -4.8e+85)
		tmp = Float64(y2 * Float64(y4 * Float64(Float64(k * y1) - Float64(c * t))));
	elseif (y4 <= -8.8e-90)
		tmp = Float64(i * Float64(z * Float64(Float64(c * t) - Float64(k * y1))));
	elseif (y4 <= 1.5e+100)
		tmp = Float64(b * Float64(a * Float64(Float64(x * y) - Float64(t * z))));
	else
		tmp = Float64(y1 * Float64(y4 * Float64(Float64(k * y2) - Float64(j * y3))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (y4 <= -4.8e+85)
		tmp = y2 * (y4 * ((k * y1) - (c * t)));
	elseif (y4 <= -8.8e-90)
		tmp = i * (z * ((c * t) - (k * y1)));
	elseif (y4 <= 1.5e+100)
		tmp = b * (a * ((x * y) - (t * z)));
	else
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[y4, -4.8e+85], N[(y2 * N[(y4 * N[(N[(k * y1), $MachinePrecision] - N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, -8.8e-90], N[(i * N[(z * N[(N[(c * t), $MachinePrecision] - N[(k * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, 1.5e+100], N[(b * N[(a * N[(N[(x * y), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y1 * N[(y4 * N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y4 \leq -4.8 \cdot 10^{+85}:\\
\;\;\;\;y2 \cdot \left(y4 \cdot \left(k \cdot y1 - c \cdot t\right)\right)\\

\mathbf{elif}\;y4 \leq -8.8 \cdot 10^{-90}:\\
\;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\

\mathbf{elif}\;y4 \leq 1.5 \cdot 10^{+100}:\\
\;\;\;\;b \cdot \left(a \cdot \left(x \cdot y - t \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y4 < -4.79999999999999993e85

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in y4 around inf

      \[\leadsto y2 \cdot \left(y4 \cdot \color{blue}{\left(k \cdot y1 - c \cdot t\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(y4 \cdot \left(k \cdot y1 - \color{blue}{c \cdot t}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(y4 \cdot \left(k \cdot y1 - c \cdot \color{blue}{t}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto y2 \cdot \left(y4 \cdot \left(k \cdot y1 - c \cdot t\right)\right) \]
      4. lower-*.f6426.3

        \[\leadsto y2 \cdot \left(y4 \cdot \left(k \cdot y1 - c \cdot t\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto y2 \cdot \left(y4 \cdot \color{blue}{\left(k \cdot y1 - c \cdot t\right)}\right) \]

    if -4.79999999999999993e85 < y4 < -8.79999999999999943e-90

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in z around -inf

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \color{blue}{\left(c \cdot t - k \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - \color{blue}{k \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
      5. lower-*.f6426.3

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]

    if -8.79999999999999943e-90 < y4 < 1.49999999999999993e100

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

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

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

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

        \[\leadsto b \cdot \left(a \cdot \left(x \cdot y - t \cdot z\right)\right) \]
      4. lower-*.f6427.0

        \[\leadsto b \cdot \left(a \cdot \left(x \cdot y - t \cdot z\right)\right) \]
    7. Applied rewrites27.0%

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

    if 1.49999999999999993e100 < y4

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in y1 around inf

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \color{blue}{\left(k \cdot y2 - j \cdot y3\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - \color{blue}{j \cdot y3}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot \color{blue}{y3}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
      5. lower-*.f6426.4

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 13: 32.1% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y4 \leq -1.9 \cdot 10^{+109}:\\ \;\;\;\;b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\ \mathbf{elif}\;y4 \leq -8.8 \cdot 10^{-90}:\\ \;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\ \mathbf{elif}\;y4 \leq 1.5 \cdot 10^{+100}:\\ \;\;\;\;b \cdot \left(a \cdot \left(x \cdot y - t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= y4 -1.9e+109)
   (* b (* y4 (- (* j t) (* k y))))
   (if (<= y4 -8.8e-90)
     (* i (* z (- (* c t) (* k y1))))
     (if (<= y4 1.5e+100)
       (* b (* a (- (* x y) (* t z))))
       (* y1 (* y4 (- (* k y2) (* j y3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y4 <= -1.9e+109) {
		tmp = b * (y4 * ((j * t) - (k * y)));
	} else if (y4 <= -8.8e-90) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y4 <= 1.5e+100) {
		tmp = b * (a * ((x * y) - (t * z)));
	} else {
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (y4 <= (-1.9d+109)) then
        tmp = b * (y4 * ((j * t) - (k * y)))
    else if (y4 <= (-8.8d-90)) then
        tmp = i * (z * ((c * t) - (k * y1)))
    else if (y4 <= 1.5d+100) then
        tmp = b * (a * ((x * y) - (t * z)))
    else
        tmp = y1 * (y4 * ((k * y2) - (j * y3)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y4 <= -1.9e+109) {
		tmp = b * (y4 * ((j * t) - (k * y)));
	} else if (y4 <= -8.8e-90) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y4 <= 1.5e+100) {
		tmp = b * (a * ((x * y) - (t * z)));
	} else {
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if y4 <= -1.9e+109:
		tmp = b * (y4 * ((j * t) - (k * y)))
	elif y4 <= -8.8e-90:
		tmp = i * (z * ((c * t) - (k * y1)))
	elif y4 <= 1.5e+100:
		tmp = b * (a * ((x * y) - (t * z)))
	else:
		tmp = y1 * (y4 * ((k * y2) - (j * y3)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (y4 <= -1.9e+109)
		tmp = Float64(b * Float64(y4 * Float64(Float64(j * t) - Float64(k * y))));
	elseif (y4 <= -8.8e-90)
		tmp = Float64(i * Float64(z * Float64(Float64(c * t) - Float64(k * y1))));
	elseif (y4 <= 1.5e+100)
		tmp = Float64(b * Float64(a * Float64(Float64(x * y) - Float64(t * z))));
	else
		tmp = Float64(y1 * Float64(y4 * Float64(Float64(k * y2) - Float64(j * y3))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (y4 <= -1.9e+109)
		tmp = b * (y4 * ((j * t) - (k * y)));
	elseif (y4 <= -8.8e-90)
		tmp = i * (z * ((c * t) - (k * y1)));
	elseif (y4 <= 1.5e+100)
		tmp = b * (a * ((x * y) - (t * z)));
	else
		tmp = y1 * (y4 * ((k * y2) - (j * y3)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[y4, -1.9e+109], N[(b * N[(y4 * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, -8.8e-90], N[(i * N[(z * N[(N[(c * t), $MachinePrecision] - N[(k * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, 1.5e+100], N[(b * N[(a * N[(N[(x * y), $MachinePrecision] - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y1 * N[(y4 * N[(N[(k * y2), $MachinePrecision] - N[(j * y3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y4 \leq -1.9 \cdot 10^{+109}:\\
\;\;\;\;b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\

\mathbf{elif}\;y4 \leq -8.8 \cdot 10^{-90}:\\
\;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\

\mathbf{elif}\;y4 \leq 1.5 \cdot 10^{+100}:\\
\;\;\;\;b \cdot \left(a \cdot \left(x \cdot y - t \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y4 < -1.90000000000000019e109

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \color{blue}{\left(j \cdot t - k \cdot y\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - \color{blue}{k \cdot y}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot \color{blue}{y}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
      5. lower-*.f6425.9

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
    7. Applied rewrites25.9%

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]

    if -1.90000000000000019e109 < y4 < -8.79999999999999943e-90

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in z around -inf

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \color{blue}{\left(c \cdot t - k \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - \color{blue}{k \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
      5. lower-*.f6426.3

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]

    if -8.79999999999999943e-90 < y4 < 1.49999999999999993e100

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

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

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

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

        \[\leadsto b \cdot \left(a \cdot \left(x \cdot y - t \cdot z\right)\right) \]
      4. lower-*.f6427.0

        \[\leadsto b \cdot \left(a \cdot \left(x \cdot y - t \cdot z\right)\right) \]
    7. Applied rewrites27.0%

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

    if 1.49999999999999993e100 < y4

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y4 around inf

      \[\leadsto \color{blue}{y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y4 \cdot \color{blue}{\left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y4 \cdot \left(\left(b \cdot \left(j \cdot t - k \cdot y\right) + y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - \color{blue}{c \cdot \left(t \cdot y2 - y \cdot y3\right)}\right) \]
    4. Applied rewrites38.0%

      \[\leadsto \color{blue}{y4 \cdot \left(\mathsf{fma}\left(b, j \cdot t - k \cdot y, y1 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) - c \cdot \left(t \cdot y2 - y \cdot y3\right)\right)} \]
    5. Taylor expanded in y1 around inf

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \color{blue}{\left(k \cdot y2 - j \cdot y3\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - \color{blue}{j \cdot y3}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot \color{blue}{y3}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
      5. lower-*.f6426.4

        \[\leadsto y1 \cdot \left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto y1 \cdot \color{blue}{\left(y4 \cdot \left(k \cdot y2 - j \cdot y3\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 14: 31.9% accurate, 4.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y2 \leq -3.9 \cdot 10^{+40}:\\ \;\;\;\;t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)\\ \mathbf{elif}\;y2 \leq -7 \cdot 10^{-71}:\\ \;\;\;\;j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right)\\ \mathbf{elif}\;y2 \leq -7.5 \cdot 10^{-200}:\\ \;\;\;\;b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\ \mathbf{elif}\;y2 \leq 4.6 \cdot 10^{+120}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= y2 -3.9e+40)
   (* t (* y2 (- (* a y5) (* c y4))))
   (if (<= y2 -7e-71)
     (* j (* y0 (- (* y3 y5) (* b x))))
     (if (<= y2 -7.5e-200)
       (* b (* y4 (- (* j t) (* k y))))
       (if (<= y2 4.6e+120)
         (* i (* k (- (* y y5) (* y1 z))))
         (* k (* y2 (- (* y1 y4) (* y0 y5)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y2 <= -3.9e+40) {
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	} else if (y2 <= -7e-71) {
		tmp = j * (y0 * ((y3 * y5) - (b * x)));
	} else if (y2 <= -7.5e-200) {
		tmp = b * (y4 * ((j * t) - (k * y)));
	} else if (y2 <= 4.6e+120) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (y2 <= (-3.9d+40)) then
        tmp = t * (y2 * ((a * y5) - (c * y4)))
    else if (y2 <= (-7d-71)) then
        tmp = j * (y0 * ((y3 * y5) - (b * x)))
    else if (y2 <= (-7.5d-200)) then
        tmp = b * (y4 * ((j * t) - (k * y)))
    else if (y2 <= 4.6d+120) then
        tmp = i * (k * ((y * y5) - (y1 * z)))
    else
        tmp = k * (y2 * ((y1 * y4) - (y0 * y5)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y2 <= -3.9e+40) {
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	} else if (y2 <= -7e-71) {
		tmp = j * (y0 * ((y3 * y5) - (b * x)));
	} else if (y2 <= -7.5e-200) {
		tmp = b * (y4 * ((j * t) - (k * y)));
	} else if (y2 <= 4.6e+120) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if y2 <= -3.9e+40:
		tmp = t * (y2 * ((a * y5) - (c * y4)))
	elif y2 <= -7e-71:
		tmp = j * (y0 * ((y3 * y5) - (b * x)))
	elif y2 <= -7.5e-200:
		tmp = b * (y4 * ((j * t) - (k * y)))
	elif y2 <= 4.6e+120:
		tmp = i * (k * ((y * y5) - (y1 * z)))
	else:
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (y2 <= -3.9e+40)
		tmp = Float64(t * Float64(y2 * Float64(Float64(a * y5) - Float64(c * y4))));
	elseif (y2 <= -7e-71)
		tmp = Float64(j * Float64(y0 * Float64(Float64(y3 * y5) - Float64(b * x))));
	elseif (y2 <= -7.5e-200)
		tmp = Float64(b * Float64(y4 * Float64(Float64(j * t) - Float64(k * y))));
	elseif (y2 <= 4.6e+120)
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	else
		tmp = Float64(k * Float64(y2 * Float64(Float64(y1 * y4) - Float64(y0 * y5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (y2 <= -3.9e+40)
		tmp = t * (y2 * ((a * y5) - (c * y4)));
	elseif (y2 <= -7e-71)
		tmp = j * (y0 * ((y3 * y5) - (b * x)));
	elseif (y2 <= -7.5e-200)
		tmp = b * (y4 * ((j * t) - (k * y)));
	elseif (y2 <= 4.6e+120)
		tmp = i * (k * ((y * y5) - (y1 * z)));
	else
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[y2, -3.9e+40], N[(t * N[(y2 * N[(N[(a * y5), $MachinePrecision] - N[(c * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -7e-71], N[(j * N[(y0 * N[(N[(y3 * y5), $MachinePrecision] - N[(b * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -7.5e-200], N[(b * N[(y4 * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 4.6e+120], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(y2 * N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y2 \leq -3.9 \cdot 10^{+40}:\\
\;\;\;\;t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)\\

\mathbf{elif}\;y2 \leq -7 \cdot 10^{-71}:\\
\;\;\;\;j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right)\\

\mathbf{elif}\;y2 \leq -7.5 \cdot 10^{-200}:\\
\;\;\;\;b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\

\mathbf{elif}\;y2 \leq 4.6 \cdot 10^{+120}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y2 < -3.9000000000000001e40

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in t around inf

      \[\leadsto t \cdot \color{blue}{\left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \color{blue}{\left(a \cdot y5 - c \cdot y4\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - \color{blue}{c \cdot y4}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot \color{blue}{y4}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right) \]
      5. lower-*.f6427.1

        \[\leadsto t \cdot \left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right) \]
    7. Applied rewrites27.1%

      \[\leadsto t \cdot \color{blue}{\left(y2 \cdot \left(a \cdot y5 - c \cdot y4\right)\right)} \]

    if -3.9000000000000001e40 < y2 < -6.9999999999999998e-71

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y0 around inf

      \[\leadsto \color{blue}{y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \color{blue}{\left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - \color{blue}{b \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot \left(k \cdot y2 - j \cdot y3\right), c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto j \cdot \color{blue}{\left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto j \cdot \left(y0 \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto j \cdot \left(y0 \cdot \left(y3 \cdot y5 - \color{blue}{b \cdot x}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot \color{blue}{x}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
      5. lower-*.f6428.0

        \[\leadsto j \cdot \left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
    7. Applied rewrites28.0%

      \[\leadsto j \cdot \color{blue}{\left(y0 \cdot \left(y3 \cdot y5 - b \cdot x\right)\right)} \]

    if -6.9999999999999998e-71 < y2 < -7.49999999999999958e-200

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \color{blue}{\left(j \cdot t - k \cdot y\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - \color{blue}{k \cdot y}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot \color{blue}{y}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
      5. lower-*.f6425.9

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
    7. Applied rewrites25.9%

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]

    if -7.49999999999999958e-200 < y2 < 4.59999999999999985e120

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]

    if 4.59999999999999985e120 < y2

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around inf

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \color{blue}{\left(y1 \cdot y4 - y0 \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - \color{blue}{y0 \cdot y5}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot \color{blue}{y5}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
      5. lower-*.f6426.9

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
    7. Applied rewrites26.9%

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 15: 31.6% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y2 \leq -1.2 \cdot 10^{-17}:\\ \;\;\;\;x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\\ \mathbf{elif}\;y2 \leq -2 \cdot 10^{-187}:\\ \;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\ \mathbf{elif}\;y2 \leq 4.6 \cdot 10^{+120}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= y2 -1.2e-17)
   (* x (* y2 (- (* c y0) (* a y1))))
   (if (<= y2 -2e-187)
     (* i (* z (- (* c t) (* k y1))))
     (if (<= y2 4.6e+120)
       (* i (* k (- (* y y5) (* y1 z))))
       (* k (* y2 (- (* y1 y4) (* y0 y5))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y2 <= -1.2e-17) {
		tmp = x * (y2 * ((c * y0) - (a * y1)));
	} else if (y2 <= -2e-187) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y2 <= 4.6e+120) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (y2 <= (-1.2d-17)) then
        tmp = x * (y2 * ((c * y0) - (a * y1)))
    else if (y2 <= (-2d-187)) then
        tmp = i * (z * ((c * t) - (k * y1)))
    else if (y2 <= 4.6d+120) then
        tmp = i * (k * ((y * y5) - (y1 * z)))
    else
        tmp = k * (y2 * ((y1 * y4) - (y0 * y5)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y2 <= -1.2e-17) {
		tmp = x * (y2 * ((c * y0) - (a * y1)));
	} else if (y2 <= -2e-187) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y2 <= 4.6e+120) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else {
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if y2 <= -1.2e-17:
		tmp = x * (y2 * ((c * y0) - (a * y1)))
	elif y2 <= -2e-187:
		tmp = i * (z * ((c * t) - (k * y1)))
	elif y2 <= 4.6e+120:
		tmp = i * (k * ((y * y5) - (y1 * z)))
	else:
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (y2 <= -1.2e-17)
		tmp = Float64(x * Float64(y2 * Float64(Float64(c * y0) - Float64(a * y1))));
	elseif (y2 <= -2e-187)
		tmp = Float64(i * Float64(z * Float64(Float64(c * t) - Float64(k * y1))));
	elseif (y2 <= 4.6e+120)
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	else
		tmp = Float64(k * Float64(y2 * Float64(Float64(y1 * y4) - Float64(y0 * y5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (y2 <= -1.2e-17)
		tmp = x * (y2 * ((c * y0) - (a * y1)));
	elseif (y2 <= -2e-187)
		tmp = i * (z * ((c * t) - (k * y1)));
	elseif (y2 <= 4.6e+120)
		tmp = i * (k * ((y * y5) - (y1 * z)));
	else
		tmp = k * (y2 * ((y1 * y4) - (y0 * y5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[y2, -1.2e-17], N[(x * N[(y2 * N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, -2e-187], N[(i * N[(z * N[(N[(c * t), $MachinePrecision] - N[(k * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y2, 4.6e+120], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(y2 * N[(N[(y1 * y4), $MachinePrecision] - N[(y0 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y2 \leq -1.2 \cdot 10^{-17}:\\
\;\;\;\;x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\\

\mathbf{elif}\;y2 \leq -2 \cdot 10^{-187}:\\
\;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\

\mathbf{elif}\;y2 \leq 4.6 \cdot 10^{+120}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y2 < -1.19999999999999993e-17

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in y2 around inf

      \[\leadsto x \cdot \color{blue}{\left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y2 \cdot \color{blue}{\left(c \cdot y0 - a \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(y2 \cdot \left(c \cdot y0 - \color{blue}{a \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto x \cdot \color{blue}{\left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)} \]

    if -1.19999999999999993e-17 < y2 < -2e-187

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in z around -inf

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \color{blue}{\left(c \cdot t - k \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - \color{blue}{k \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
      5. lower-*.f6426.3

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]

    if -2e-187 < y2 < 4.59999999999999985e120

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]

    if 4.59999999999999985e120 < y2

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y2 around inf

      \[\leadsto \color{blue}{y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y2 \cdot \color{blue}{\left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y2 \cdot \left(\left(k \cdot \left(y1 \cdot y4 - y0 \cdot y5\right) + x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{t \cdot \left(c \cdot y4 - a \cdot y5\right)}\right) \]
    4. Applied rewrites37.7%

      \[\leadsto \color{blue}{y2 \cdot \left(\mathsf{fma}\left(k, y1 \cdot y4 - y0 \cdot y5, x \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - t \cdot \left(c \cdot y4 - a \cdot y5\right)\right)} \]
    5. Taylor expanded in k around inf

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \color{blue}{\left(y1 \cdot y4 - y0 \cdot y5\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - \color{blue}{y0 \cdot y5}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot \color{blue}{y5}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
      5. lower-*.f6426.9

        \[\leadsto k \cdot \left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right) \]
    7. Applied rewrites26.9%

      \[\leadsto k \cdot \color{blue}{\left(y2 \cdot \left(y1 \cdot y4 - y0 \cdot y5\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 16: 30.7% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\\ \mathbf{if}\;y0 \leq -5.5 \cdot 10^{+188}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y0 \leq -1.65 \cdot 10^{-45}:\\ \;\;\;\;b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\ \mathbf{elif}\;y0 \leq 5 \cdot 10^{-60}:\\ \;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* x (* y2 (- (* c y0) (* a y1))))))
   (if (<= y0 -5.5e+188)
     t_1
     (if (<= y0 -1.65e-45)
       (* b (* y4 (- (* j t) (* k y))))
       (if (<= y0 5e-60) (* i (* z (- (* c t) (* k y1)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = x * (y2 * ((c * y0) - (a * y1)));
	double tmp;
	if (y0 <= -5.5e+188) {
		tmp = t_1;
	} else if (y0 <= -1.65e-45) {
		tmp = b * (y4 * ((j * t) - (k * y)));
	} else if (y0 <= 5e-60) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (y2 * ((c * y0) - (a * y1)))
    if (y0 <= (-5.5d+188)) then
        tmp = t_1
    else if (y0 <= (-1.65d-45)) then
        tmp = b * (y4 * ((j * t) - (k * y)))
    else if (y0 <= 5d-60) then
        tmp = i * (z * ((c * t) - (k * y1)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = x * (y2 * ((c * y0) - (a * y1)));
	double tmp;
	if (y0 <= -5.5e+188) {
		tmp = t_1;
	} else if (y0 <= -1.65e-45) {
		tmp = b * (y4 * ((j * t) - (k * y)));
	} else if (y0 <= 5e-60) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = x * (y2 * ((c * y0) - (a * y1)))
	tmp = 0
	if y0 <= -5.5e+188:
		tmp = t_1
	elif y0 <= -1.65e-45:
		tmp = b * (y4 * ((j * t) - (k * y)))
	elif y0 <= 5e-60:
		tmp = i * (z * ((c * t) - (k * y1)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(x * Float64(y2 * Float64(Float64(c * y0) - Float64(a * y1))))
	tmp = 0.0
	if (y0 <= -5.5e+188)
		tmp = t_1;
	elseif (y0 <= -1.65e-45)
		tmp = Float64(b * Float64(y4 * Float64(Float64(j * t) - Float64(k * y))));
	elseif (y0 <= 5e-60)
		tmp = Float64(i * Float64(z * Float64(Float64(c * t) - Float64(k * y1))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = x * (y2 * ((c * y0) - (a * y1)));
	tmp = 0.0;
	if (y0 <= -5.5e+188)
		tmp = t_1;
	elseif (y0 <= -1.65e-45)
		tmp = b * (y4 * ((j * t) - (k * y)));
	elseif (y0 <= 5e-60)
		tmp = i * (z * ((c * t) - (k * y1)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(x * N[(y2 * N[(N[(c * y0), $MachinePrecision] - N[(a * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y0, -5.5e+188], t$95$1, If[LessEqual[y0, -1.65e-45], N[(b * N[(y4 * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y0, 5e-60], N[(i * N[(z * N[(N[(c * t), $MachinePrecision] - N[(k * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\\
\mathbf{if}\;y0 \leq -5.5 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y0 \leq -1.65 \cdot 10^{-45}:\\
\;\;\;\;b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\

\mathbf{elif}\;y0 \leq 5 \cdot 10^{-60}:\\
\;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y0 < -5.50000000000000013e188 or 5.0000000000000001e-60 < y0

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in y2 around inf

      \[\leadsto x \cdot \color{blue}{\left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(y2 \cdot \color{blue}{\left(c \cdot y0 - a \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(y2 \cdot \left(c \cdot y0 - \color{blue}{a \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto x \cdot \left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto x \cdot \color{blue}{\left(y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right)} \]

    if -5.50000000000000013e188 < y0 < -1.65e-45

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \color{blue}{\left(j \cdot t - k \cdot y\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - \color{blue}{k \cdot y}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot \color{blue}{y}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
      5. lower-*.f6425.9

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
    7. Applied rewrites25.9%

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]

    if -1.65e-45 < y0 < 5.0000000000000001e-60

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in z around -inf

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \color{blue}{\left(c \cdot t - k \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - \color{blue}{k \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
      5. lower-*.f6426.3

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 29.8% accurate, 4.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\ \mathbf{if}\;y4 \leq -1.9 \cdot 10^{+109}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y4 \leq -1.95 \cdot 10^{-101}:\\ \;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\ \mathbf{elif}\;y4 \leq -6.2 \cdot 10^{-241}:\\ \;\;\;\;b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right)\\ \mathbf{elif}\;y4 \leq 1.05 \cdot 10^{+46}:\\ \;\;\;\;i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* b (* y4 (- (* j t) (* k y))))))
   (if (<= y4 -1.9e+109)
     t_1
     (if (<= y4 -1.95e-101)
       (* i (* z (- (* c t) (* k y1))))
       (if (<= y4 -6.2e-241)
         (* b (* t (* -1.0 (* a z))))
         (if (<= y4 1.05e+46) (* i (* y1 (- (* j x) (* k z)))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = b * (y4 * ((j * t) - (k * y)));
	double tmp;
	if (y4 <= -1.9e+109) {
		tmp = t_1;
	} else if (y4 <= -1.95e-101) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y4 <= -6.2e-241) {
		tmp = b * (t * (-1.0 * (a * z)));
	} else if (y4 <= 1.05e+46) {
		tmp = i * (y1 * ((j * x) - (k * z)));
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = b * (y4 * ((j * t) - (k * y)))
    if (y4 <= (-1.9d+109)) then
        tmp = t_1
    else if (y4 <= (-1.95d-101)) then
        tmp = i * (z * ((c * t) - (k * y1)))
    else if (y4 <= (-6.2d-241)) then
        tmp = b * (t * ((-1.0d0) * (a * z)))
    else if (y4 <= 1.05d+46) then
        tmp = i * (y1 * ((j * x) - (k * z)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = b * (y4 * ((j * t) - (k * y)));
	double tmp;
	if (y4 <= -1.9e+109) {
		tmp = t_1;
	} else if (y4 <= -1.95e-101) {
		tmp = i * (z * ((c * t) - (k * y1)));
	} else if (y4 <= -6.2e-241) {
		tmp = b * (t * (-1.0 * (a * z)));
	} else if (y4 <= 1.05e+46) {
		tmp = i * (y1 * ((j * x) - (k * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = b * (y4 * ((j * t) - (k * y)))
	tmp = 0
	if y4 <= -1.9e+109:
		tmp = t_1
	elif y4 <= -1.95e-101:
		tmp = i * (z * ((c * t) - (k * y1)))
	elif y4 <= -6.2e-241:
		tmp = b * (t * (-1.0 * (a * z)))
	elif y4 <= 1.05e+46:
		tmp = i * (y1 * ((j * x) - (k * z)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(b * Float64(y4 * Float64(Float64(j * t) - Float64(k * y))))
	tmp = 0.0
	if (y4 <= -1.9e+109)
		tmp = t_1;
	elseif (y4 <= -1.95e-101)
		tmp = Float64(i * Float64(z * Float64(Float64(c * t) - Float64(k * y1))));
	elseif (y4 <= -6.2e-241)
		tmp = Float64(b * Float64(t * Float64(-1.0 * Float64(a * z))));
	elseif (y4 <= 1.05e+46)
		tmp = Float64(i * Float64(y1 * Float64(Float64(j * x) - Float64(k * z))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = b * (y4 * ((j * t) - (k * y)));
	tmp = 0.0;
	if (y4 <= -1.9e+109)
		tmp = t_1;
	elseif (y4 <= -1.95e-101)
		tmp = i * (z * ((c * t) - (k * y1)));
	elseif (y4 <= -6.2e-241)
		tmp = b * (t * (-1.0 * (a * z)));
	elseif (y4 <= 1.05e+46)
		tmp = i * (y1 * ((j * x) - (k * z)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(b * N[(y4 * N[(N[(j * t), $MachinePrecision] - N[(k * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y4, -1.9e+109], t$95$1, If[LessEqual[y4, -1.95e-101], N[(i * N[(z * N[(N[(c * t), $MachinePrecision] - N[(k * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, -6.2e-241], N[(b * N[(t * N[(-1.0 * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y4, 1.05e+46], N[(i * N[(y1 * N[(N[(j * x), $MachinePrecision] - N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)\\
\mathbf{if}\;y4 \leq -1.9 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y4 \leq -1.95 \cdot 10^{-101}:\\
\;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\

\mathbf{elif}\;y4 \leq -6.2 \cdot 10^{-241}:\\
\;\;\;\;b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right)\\

\mathbf{elif}\;y4 \leq 1.05 \cdot 10^{+46}:\\
\;\;\;\;i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y4 < -1.90000000000000019e109 or 1.05e46 < y4

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \color{blue}{\left(j \cdot t - k \cdot y\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - \color{blue}{k \cdot y}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot \color{blue}{y}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
      5. lower-*.f6425.9

        \[\leadsto b \cdot \left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right) \]
    7. Applied rewrites25.9%

      \[\leadsto b \cdot \color{blue}{\left(y4 \cdot \left(j \cdot t - k \cdot y\right)\right)} \]

    if -1.90000000000000019e109 < y4 < -1.95000000000000008e-101

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in z around -inf

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \color{blue}{\left(c \cdot t - k \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - \color{blue}{k \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
      5. lower-*.f6426.3

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]

    if -1.95000000000000008e-101 < y4 < -6.1999999999999998e-241

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around inf

      \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot \color{blue}{z}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right) \]
      2. lower-*.f6417.0

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right) \]
    10. Applied rewrites17.0%

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

    if -6.1999999999999998e-241 < y4 < 1.05e46

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in y1 around -inf

      \[\leadsto i \cdot \color{blue}{\left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \color{blue}{\left(j \cdot x - k \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - \color{blue}{k \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto i \cdot \color{blue}{\left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 18: 29.5% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -8.5 \cdot 10^{+165}:\\ \;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.12 \cdot 10^{+77}:\\ \;\;\;\;\left(y5 \cdot y - y1 \cdot z\right) \cdot \left(k \cdot i\right)\\ \mathbf{elif}\;c \leq 6.8 \cdot 10^{-76}:\\ \;\;\;\;y1 \cdot \left(z \cdot \left(a \cdot y3 - i \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= c -8.5e+165)
   (* -1.0 (* y3 (* z (* c y0))))
   (if (<= c -1.12e+77)
     (* (- (* y5 y) (* y1 z)) (* k i))
     (if (<= c 6.8e-76)
       (* y1 (* z (- (* a y3) (* i k))))
       (* i (* z (- (* c t) (* k y1))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (c <= -8.5e+165) {
		tmp = -1.0 * (y3 * (z * (c * y0)));
	} else if (c <= -1.12e+77) {
		tmp = ((y5 * y) - (y1 * z)) * (k * i);
	} else if (c <= 6.8e-76) {
		tmp = y1 * (z * ((a * y3) - (i * k)));
	} else {
		tmp = i * (z * ((c * t) - (k * y1)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (c <= (-8.5d+165)) then
        tmp = (-1.0d0) * (y3 * (z * (c * y0)))
    else if (c <= (-1.12d+77)) then
        tmp = ((y5 * y) - (y1 * z)) * (k * i)
    else if (c <= 6.8d-76) then
        tmp = y1 * (z * ((a * y3) - (i * k)))
    else
        tmp = i * (z * ((c * t) - (k * y1)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (c <= -8.5e+165) {
		tmp = -1.0 * (y3 * (z * (c * y0)));
	} else if (c <= -1.12e+77) {
		tmp = ((y5 * y) - (y1 * z)) * (k * i);
	} else if (c <= 6.8e-76) {
		tmp = y1 * (z * ((a * y3) - (i * k)));
	} else {
		tmp = i * (z * ((c * t) - (k * y1)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if c <= -8.5e+165:
		tmp = -1.0 * (y3 * (z * (c * y0)))
	elif c <= -1.12e+77:
		tmp = ((y5 * y) - (y1 * z)) * (k * i)
	elif c <= 6.8e-76:
		tmp = y1 * (z * ((a * y3) - (i * k)))
	else:
		tmp = i * (z * ((c * t) - (k * y1)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (c <= -8.5e+165)
		tmp = Float64(-1.0 * Float64(y3 * Float64(z * Float64(c * y0))));
	elseif (c <= -1.12e+77)
		tmp = Float64(Float64(Float64(y5 * y) - Float64(y1 * z)) * Float64(k * i));
	elseif (c <= 6.8e-76)
		tmp = Float64(y1 * Float64(z * Float64(Float64(a * y3) - Float64(i * k))));
	else
		tmp = Float64(i * Float64(z * Float64(Float64(c * t) - Float64(k * y1))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (c <= -8.5e+165)
		tmp = -1.0 * (y3 * (z * (c * y0)));
	elseif (c <= -1.12e+77)
		tmp = ((y5 * y) - (y1 * z)) * (k * i);
	elseif (c <= 6.8e-76)
		tmp = y1 * (z * ((a * y3) - (i * k)));
	else
		tmp = i * (z * ((c * t) - (k * y1)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[c, -8.5e+165], N[(-1.0 * N[(y3 * N[(z * N[(c * y0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.12e+77], N[(N[(N[(y5 * y), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision] * N[(k * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.8e-76], N[(y1 * N[(z * N[(N[(a * y3), $MachinePrecision] - N[(i * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(z * N[(N[(c * t), $MachinePrecision] - N[(k * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.5 \cdot 10^{+165}:\\
\;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right)\\

\mathbf{elif}\;c \leq -1.12 \cdot 10^{+77}:\\
\;\;\;\;\left(y5 \cdot y - y1 \cdot z\right) \cdot \left(k \cdot i\right)\\

\mathbf{elif}\;c \leq 6.8 \cdot 10^{-76}:\\
\;\;\;\;y1 \cdot \left(z \cdot \left(a \cdot y3 - i \cdot k\right)\right)\\

\mathbf{else}:\\
\;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -8.5000000000000001e165

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in y3 around inf

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \color{blue}{\left(c \cdot y0 - a \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - \color{blue}{a \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in a around 0

      \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.9

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right) \]
    10. Applied rewrites16.9%

      \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right) \]

    if -8.5000000000000001e165 < c < -1.1199999999999999e77

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lift-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(i \cdot k\right) \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(y \cdot y5 - y1 \cdot z\right) \cdot \left(i \cdot \color{blue}{k}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \left(y \cdot y5 - y1 \cdot z\right) \cdot \left(i \cdot \color{blue}{k}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(y \cdot y5 - y1 \cdot z\right) \cdot \left(i \cdot k\right) \]
      7. *-commutativeN/A

        \[\leadsto \left(y5 \cdot y - y1 \cdot z\right) \cdot \left(i \cdot k\right) \]
      8. lower-*.f64N/A

        \[\leadsto \left(y5 \cdot y - y1 \cdot z\right) \cdot \left(i \cdot k\right) \]
      9. *-commutativeN/A

        \[\leadsto \left(y5 \cdot y - y1 \cdot z\right) \cdot \left(k \cdot i\right) \]
      10. lower-*.f6424.4

        \[\leadsto \left(y5 \cdot y - y1 \cdot z\right) \cdot \left(k \cdot i\right) \]
    9. Applied rewrites24.4%

      \[\leadsto \left(y5 \cdot y - y1 \cdot z\right) \cdot \left(k \cdot \color{blue}{i}\right) \]

    if -1.1199999999999999e77 < c < 6.7999999999999998e-76

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in y1 around -inf

      \[\leadsto y1 \cdot \color{blue}{\left(z \cdot \left(a \cdot y3 - i \cdot k\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(z \cdot \color{blue}{\left(a \cdot y3 - i \cdot k\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(z \cdot \left(a \cdot y3 - \color{blue}{i \cdot k}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto y1 \cdot \left(z \cdot \left(a \cdot y3 - i \cdot \color{blue}{k}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto y1 \cdot \left(z \cdot \left(a \cdot y3 - i \cdot k\right)\right) \]
      5. lower-*.f6426.7

        \[\leadsto y1 \cdot \left(z \cdot \left(a \cdot y3 - i \cdot k\right)\right) \]
    7. Applied rewrites26.7%

      \[\leadsto y1 \cdot \color{blue}{\left(z \cdot \left(a \cdot y3 - i \cdot k\right)\right)} \]

    if 6.7999999999999998e-76 < c

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in z around -inf

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \color{blue}{\left(c \cdot t - k \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - \color{blue}{k \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
      5. lower-*.f6426.3

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 19: 29.5% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -8.5 \cdot 10^{+165}:\\ \;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right)\\ \mathbf{elif}\;c \leq -3 \cdot 10^{-266}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \mathbf{elif}\;c \leq 1.5 \cdot 10^{-90}:\\ \;\;\;\;i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= c -8.5e+165)
   (* -1.0 (* y3 (* z (* c y0))))
   (if (<= c -3e-266)
     (* i (* k (- (* y y5) (* y1 z))))
     (if (<= c 1.5e-90)
       (* i (* y1 (- (* j x) (* k z))))
       (* i (* z (- (* c t) (* k y1))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (c <= -8.5e+165) {
		tmp = -1.0 * (y3 * (z * (c * y0)));
	} else if (c <= -3e-266) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (c <= 1.5e-90) {
		tmp = i * (y1 * ((j * x) - (k * z)));
	} else {
		tmp = i * (z * ((c * t) - (k * y1)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (c <= (-8.5d+165)) then
        tmp = (-1.0d0) * (y3 * (z * (c * y0)))
    else if (c <= (-3d-266)) then
        tmp = i * (k * ((y * y5) - (y1 * z)))
    else if (c <= 1.5d-90) then
        tmp = i * (y1 * ((j * x) - (k * z)))
    else
        tmp = i * (z * ((c * t) - (k * y1)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (c <= -8.5e+165) {
		tmp = -1.0 * (y3 * (z * (c * y0)));
	} else if (c <= -3e-266) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (c <= 1.5e-90) {
		tmp = i * (y1 * ((j * x) - (k * z)));
	} else {
		tmp = i * (z * ((c * t) - (k * y1)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if c <= -8.5e+165:
		tmp = -1.0 * (y3 * (z * (c * y0)))
	elif c <= -3e-266:
		tmp = i * (k * ((y * y5) - (y1 * z)))
	elif c <= 1.5e-90:
		tmp = i * (y1 * ((j * x) - (k * z)))
	else:
		tmp = i * (z * ((c * t) - (k * y1)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (c <= -8.5e+165)
		tmp = Float64(-1.0 * Float64(y3 * Float64(z * Float64(c * y0))));
	elseif (c <= -3e-266)
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	elseif (c <= 1.5e-90)
		tmp = Float64(i * Float64(y1 * Float64(Float64(j * x) - Float64(k * z))));
	else
		tmp = Float64(i * Float64(z * Float64(Float64(c * t) - Float64(k * y1))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (c <= -8.5e+165)
		tmp = -1.0 * (y3 * (z * (c * y0)));
	elseif (c <= -3e-266)
		tmp = i * (k * ((y * y5) - (y1 * z)));
	elseif (c <= 1.5e-90)
		tmp = i * (y1 * ((j * x) - (k * z)));
	else
		tmp = i * (z * ((c * t) - (k * y1)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[c, -8.5e+165], N[(-1.0 * N[(y3 * N[(z * N[(c * y0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -3e-266], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.5e-90], N[(i * N[(y1 * N[(N[(j * x), $MachinePrecision] - N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(z * N[(N[(c * t), $MachinePrecision] - N[(k * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.5 \cdot 10^{+165}:\\
\;\;\;\;-1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right)\\

\mathbf{elif}\;c \leq -3 \cdot 10^{-266}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\

\mathbf{elif}\;c \leq 1.5 \cdot 10^{-90}:\\
\;\;\;\;i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -8.5000000000000001e165

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(z \cdot \left(\left(t \cdot \left(a \cdot b - c \cdot i\right) + y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{k \cdot \left(b \cdot y0 - i \cdot y1\right)}\right)\right) \]
    4. Applied rewrites36.9%

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(t, a \cdot b - c \cdot i, y3 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - k \cdot \left(b \cdot y0 - i \cdot y1\right)\right)\right)} \]
    5. Taylor expanded in y3 around inf

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \color{blue}{\left(c \cdot y0 - a \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - \color{blue}{a \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto -1 \cdot \left(y3 \cdot \color{blue}{\left(z \cdot \left(c \cdot y0 - a \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in a around 0

      \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.9

        \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right) \]
    10. Applied rewrites16.9%

      \[\leadsto -1 \cdot \left(y3 \cdot \left(z \cdot \left(c \cdot y0\right)\right)\right) \]

    if -8.5000000000000001e165 < c < -3e-266

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]

    if -3e-266 < c < 1.5000000000000001e-90

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in y1 around -inf

      \[\leadsto i \cdot \color{blue}{\left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \color{blue}{\left(j \cdot x - k \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - \color{blue}{k \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto i \cdot \color{blue}{\left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]

    if 1.5000000000000001e-90 < c

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in z around -inf

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \color{blue}{\left(c \cdot t - k \cdot y1\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - \color{blue}{k \cdot y1}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot \color{blue}{y1}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
      5. lower-*.f6426.3

        \[\leadsto i \cdot \left(z \cdot \left(c \cdot t - k \cdot y1\right)\right) \]
    7. Applied rewrites26.3%

      \[\leadsto i \cdot \color{blue}{\left(z \cdot \left(c \cdot t - k \cdot y1\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 20: 28.3% accurate, 5.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;j \leq -1.3 \cdot 10^{+154}:\\ \;\;\;\;y0 \cdot \left(j \cdot \left(-1 \cdot \left(b \cdot x\right)\right)\right)\\ \mathbf{elif}\;j \leq 1.7 \cdot 10^{+112}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \mathbf{elif}\;j \leq 5.9 \cdot 10^{+200}:\\ \;\;\;\;b \cdot \left(t \cdot \left(j \cdot y4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= j -1.3e+154)
   (* y0 (* j (* -1.0 (* b x))))
   (if (<= j 1.7e+112)
     (* i (* k (- (* y y5) (* y1 z))))
     (if (<= j 5.9e+200) (* b (* t (* j y4))) (* y0 (* j (* y3 y5)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (j <= -1.3e+154) {
		tmp = y0 * (j * (-1.0 * (b * x)));
	} else if (j <= 1.7e+112) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (j <= 5.9e+200) {
		tmp = b * (t * (j * y4));
	} else {
		tmp = y0 * (j * (y3 * y5));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (j <= (-1.3d+154)) then
        tmp = y0 * (j * ((-1.0d0) * (b * x)))
    else if (j <= 1.7d+112) then
        tmp = i * (k * ((y * y5) - (y1 * z)))
    else if (j <= 5.9d+200) then
        tmp = b * (t * (j * y4))
    else
        tmp = y0 * (j * (y3 * y5))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (j <= -1.3e+154) {
		tmp = y0 * (j * (-1.0 * (b * x)));
	} else if (j <= 1.7e+112) {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	} else if (j <= 5.9e+200) {
		tmp = b * (t * (j * y4));
	} else {
		tmp = y0 * (j * (y3 * y5));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if j <= -1.3e+154:
		tmp = y0 * (j * (-1.0 * (b * x)))
	elif j <= 1.7e+112:
		tmp = i * (k * ((y * y5) - (y1 * z)))
	elif j <= 5.9e+200:
		tmp = b * (t * (j * y4))
	else:
		tmp = y0 * (j * (y3 * y5))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (j <= -1.3e+154)
		tmp = Float64(y0 * Float64(j * Float64(-1.0 * Float64(b * x))));
	elseif (j <= 1.7e+112)
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	elseif (j <= 5.9e+200)
		tmp = Float64(b * Float64(t * Float64(j * y4)));
	else
		tmp = Float64(y0 * Float64(j * Float64(y3 * y5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (j <= -1.3e+154)
		tmp = y0 * (j * (-1.0 * (b * x)));
	elseif (j <= 1.7e+112)
		tmp = i * (k * ((y * y5) - (y1 * z)));
	elseif (j <= 5.9e+200)
		tmp = b * (t * (j * y4));
	else
		tmp = y0 * (j * (y3 * y5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[j, -1.3e+154], N[(y0 * N[(j * N[(-1.0 * N[(b * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.7e+112], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.9e+200], N[(b * N[(t * N[(j * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y0 * N[(j * N[(y3 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.3 \cdot 10^{+154}:\\
\;\;\;\;y0 \cdot \left(j \cdot \left(-1 \cdot \left(b \cdot x\right)\right)\right)\\

\mathbf{elif}\;j \leq 1.7 \cdot 10^{+112}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\

\mathbf{elif}\;j \leq 5.9 \cdot 10^{+200}:\\
\;\;\;\;b \cdot \left(t \cdot \left(j \cdot y4\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if j < -1.29999999999999994e154

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y0 around inf

      \[\leadsto \color{blue}{y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \color{blue}{\left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - \color{blue}{b \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot \left(k \cdot y2 - j \cdot y3\right), c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto y0 \cdot \left(j \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - \color{blue}{b \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
      4. lower-*.f6427.6

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
    7. Applied rewrites27.6%

      \[\leadsto y0 \cdot \left(j \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
    8. Taylor expanded in x around inf

      \[\leadsto y0 \cdot \left(j \cdot \left(-1 \cdot \left(b \cdot \color{blue}{x}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(-1 \cdot \left(b \cdot x\right)\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto y0 \cdot \left(j \cdot \left(-1 \cdot \left(b \cdot x\right)\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto y0 \cdot \left(j \cdot \left(-1 \cdot \left(b \cdot \color{blue}{x}\right)\right)\right) \]

    if -1.29999999999999994e154 < j < 1.69999999999999997e112

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]

    if 1.69999999999999997e112 < j < 5.9000000000000001e200

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around 0

      \[\leadsto b \cdot \left(t \cdot \left(j \cdot y4\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.8

        \[\leadsto b \cdot \left(t \cdot \left(j \cdot y4\right)\right) \]
    10. Applied rewrites16.8%

      \[\leadsto b \cdot \left(t \cdot \left(j \cdot y4\right)\right) \]

    if 5.9000000000000001e200 < j

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y0 around inf

      \[\leadsto \color{blue}{y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \color{blue}{\left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - \color{blue}{b \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot \left(k \cdot y2 - j \cdot y3\right), c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto y0 \cdot \left(j \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - \color{blue}{b \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
      4. lower-*.f6427.6

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
    7. Applied rewrites27.6%

      \[\leadsto y0 \cdot \left(j \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6417.8

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]
    10. Applied rewrites17.8%

      \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 21: 28.3% accurate, 4.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+134}:\\ \;\;\;\;x \cdot \left(-1 \cdot \left(\left(c \cdot y\right) \cdot i\right)\right)\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-40}:\\ \;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-306}:\\ \;\;\;\;b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+85}:\\ \;\;\;\;i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+155}:\\ \;\;\;\;b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= y -5.2e+134)
   (* x (* -1.0 (* (* c y) i)))
   (if (<= y -1.9e-40)
     (* b (* y0 (* k z)))
     (if (<= y -3.8e-306)
       (* b (* -1.0 (* a (* t z))))
       (if (<= y 2.9e+85)
         (* i (* k (* -1.0 (* y1 z))))
         (if (<= y 1.35e+155)
           (* b (* t (* -1.0 (* a z))))
           (* (- (* (* i y) c)) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y <= -5.2e+134) {
		tmp = x * (-1.0 * ((c * y) * i));
	} else if (y <= -1.9e-40) {
		tmp = b * (y0 * (k * z));
	} else if (y <= -3.8e-306) {
		tmp = b * (-1.0 * (a * (t * z)));
	} else if (y <= 2.9e+85) {
		tmp = i * (k * (-1.0 * (y1 * z)));
	} else if (y <= 1.35e+155) {
		tmp = b * (t * (-1.0 * (a * z)));
	} else {
		tmp = -((i * y) * c) * x;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (y <= (-5.2d+134)) then
        tmp = x * ((-1.0d0) * ((c * y) * i))
    else if (y <= (-1.9d-40)) then
        tmp = b * (y0 * (k * z))
    else if (y <= (-3.8d-306)) then
        tmp = b * ((-1.0d0) * (a * (t * z)))
    else if (y <= 2.9d+85) then
        tmp = i * (k * ((-1.0d0) * (y1 * z)))
    else if (y <= 1.35d+155) then
        tmp = b * (t * ((-1.0d0) * (a * z)))
    else
        tmp = -((i * y) * c) * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (y <= -5.2e+134) {
		tmp = x * (-1.0 * ((c * y) * i));
	} else if (y <= -1.9e-40) {
		tmp = b * (y0 * (k * z));
	} else if (y <= -3.8e-306) {
		tmp = b * (-1.0 * (a * (t * z)));
	} else if (y <= 2.9e+85) {
		tmp = i * (k * (-1.0 * (y1 * z)));
	} else if (y <= 1.35e+155) {
		tmp = b * (t * (-1.0 * (a * z)));
	} else {
		tmp = -((i * y) * c) * x;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if y <= -5.2e+134:
		tmp = x * (-1.0 * ((c * y) * i))
	elif y <= -1.9e-40:
		tmp = b * (y0 * (k * z))
	elif y <= -3.8e-306:
		tmp = b * (-1.0 * (a * (t * z)))
	elif y <= 2.9e+85:
		tmp = i * (k * (-1.0 * (y1 * z)))
	elif y <= 1.35e+155:
		tmp = b * (t * (-1.0 * (a * z)))
	else:
		tmp = -((i * y) * c) * x
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (y <= -5.2e+134)
		tmp = Float64(x * Float64(-1.0 * Float64(Float64(c * y) * i)));
	elseif (y <= -1.9e-40)
		tmp = Float64(b * Float64(y0 * Float64(k * z)));
	elseif (y <= -3.8e-306)
		tmp = Float64(b * Float64(-1.0 * Float64(a * Float64(t * z))));
	elseif (y <= 2.9e+85)
		tmp = Float64(i * Float64(k * Float64(-1.0 * Float64(y1 * z))));
	elseif (y <= 1.35e+155)
		tmp = Float64(b * Float64(t * Float64(-1.0 * Float64(a * z))));
	else
		tmp = Float64(Float64(-Float64(Float64(i * y) * c)) * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (y <= -5.2e+134)
		tmp = x * (-1.0 * ((c * y) * i));
	elseif (y <= -1.9e-40)
		tmp = b * (y0 * (k * z));
	elseif (y <= -3.8e-306)
		tmp = b * (-1.0 * (a * (t * z)));
	elseif (y <= 2.9e+85)
		tmp = i * (k * (-1.0 * (y1 * z)));
	elseif (y <= 1.35e+155)
		tmp = b * (t * (-1.0 * (a * z)));
	else
		tmp = -((i * y) * c) * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[y, -5.2e+134], N[(x * N[(-1.0 * N[(N[(c * y), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.9e-40], N[(b * N[(y0 * N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-306], N[(b * N[(-1.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+85], N[(i * N[(k * N[(-1.0 * N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+155], N[(b * N[(t * N[(-1.0 * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(N[(i * y), $MachinePrecision] * c), $MachinePrecision]) * x), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+134}:\\
\;\;\;\;x \cdot \left(-1 \cdot \left(\left(c \cdot y\right) \cdot i\right)\right)\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-40}:\\
\;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-306}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+85}:\\
\;\;\;\;i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right)\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{+155}:\\
\;\;\;\;b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -5.2000000000000003e134

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in i around -inf

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \color{blue}{\left(c \cdot y - j \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - \color{blue}{j \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.2

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.2%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
      2. lower-*.f6416.9

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
    10. Applied rewrites16.9%

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
      2. lift-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(y \cdot i\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(\left(c \cdot y\right) \cdot i\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(\left(c \cdot y\right) \cdot i\right)\right) \]
      6. lower-*.f6416.6

        \[\leadsto x \cdot \left(-1 \cdot \left(\left(c \cdot y\right) \cdot i\right)\right) \]
    12. Applied rewrites16.6%

      \[\leadsto x \cdot \left(-1 \cdot \left(\left(c \cdot y\right) \cdot i\right)\right) \]

    if -5.2000000000000003e134 < y < -1.8999999999999999e-40

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - \color{blue}{j \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
      4. lower-*.f6426.5

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.6

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    10. Applied rewrites16.6%

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]

    if -1.8999999999999999e-40 < y < -3.8e-306

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around inf

      \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \color{blue}{\left(t \cdot z\right)}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right) \]
      3. lower-*.f6417.3

        \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right) \]
    10. Applied rewrites17.3%

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

    if -3.8e-306 < y < 2.89999999999999997e85

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around 0

      \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot \color{blue}{z}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right) \]
      2. lower-*.f6417.0

        \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right) \]
    10. Applied rewrites17.0%

      \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot \color{blue}{z}\right)\right)\right) \]

    if 2.89999999999999997e85 < y < 1.34999999999999997e155

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around inf

      \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot \color{blue}{z}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right) \]
      2. lower-*.f6417.0

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right) \]
    10. Applied rewrites17.0%

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

    if 1.34999999999999997e155 < y

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in i around -inf

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \color{blue}{\left(c \cdot y - j \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - \color{blue}{j \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.2

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.2%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
      2. lower-*.f6416.9

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
    10. Applied rewrites16.9%

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
      3. lower-*.f6416.9

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
    12. Applied rewrites16.9%

      \[\leadsto \left(-\left(i \cdot y\right) \cdot c\right) \cdot \color{blue}{x} \]
  3. Recombined 6 regimes into one program.
  4. Add Preprocessing

Alternative 22: 22.0% accurate, 4.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{+134}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-40}:\\ \;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-306}:\\ \;\;\;\;b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+85}:\\ \;\;\;\;i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+155}:\\ \;\;\;\;b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* (- (* (* i y) c)) x)))
   (if (<= y -5.2e+134)
     t_1
     (if (<= y -1.9e-40)
       (* b (* y0 (* k z)))
       (if (<= y -3.8e-306)
         (* b (* -1.0 (* a (* t z))))
         (if (<= y 2.9e+85)
           (* i (* k (* -1.0 (* y1 z))))
           (if (<= y 1.35e+155) (* b (* t (* -1.0 (* a z)))) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = -((i * y) * c) * x;
	double tmp;
	if (y <= -5.2e+134) {
		tmp = t_1;
	} else if (y <= -1.9e-40) {
		tmp = b * (y0 * (k * z));
	} else if (y <= -3.8e-306) {
		tmp = b * (-1.0 * (a * (t * z)));
	} else if (y <= 2.9e+85) {
		tmp = i * (k * (-1.0 * (y1 * z)));
	} else if (y <= 1.35e+155) {
		tmp = b * (t * (-1.0 * (a * z)));
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -((i * y) * c) * x
    if (y <= (-5.2d+134)) then
        tmp = t_1
    else if (y <= (-1.9d-40)) then
        tmp = b * (y0 * (k * z))
    else if (y <= (-3.8d-306)) then
        tmp = b * ((-1.0d0) * (a * (t * z)))
    else if (y <= 2.9d+85) then
        tmp = i * (k * ((-1.0d0) * (y1 * z)))
    else if (y <= 1.35d+155) then
        tmp = b * (t * ((-1.0d0) * (a * z)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = -((i * y) * c) * x;
	double tmp;
	if (y <= -5.2e+134) {
		tmp = t_1;
	} else if (y <= -1.9e-40) {
		tmp = b * (y0 * (k * z));
	} else if (y <= -3.8e-306) {
		tmp = b * (-1.0 * (a * (t * z)));
	} else if (y <= 2.9e+85) {
		tmp = i * (k * (-1.0 * (y1 * z)));
	} else if (y <= 1.35e+155) {
		tmp = b * (t * (-1.0 * (a * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = -((i * y) * c) * x
	tmp = 0
	if y <= -5.2e+134:
		tmp = t_1
	elif y <= -1.9e-40:
		tmp = b * (y0 * (k * z))
	elif y <= -3.8e-306:
		tmp = b * (-1.0 * (a * (t * z)))
	elif y <= 2.9e+85:
		tmp = i * (k * (-1.0 * (y1 * z)))
	elif y <= 1.35e+155:
		tmp = b * (t * (-1.0 * (a * z)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(-Float64(Float64(i * y) * c)) * x)
	tmp = 0.0
	if (y <= -5.2e+134)
		tmp = t_1;
	elseif (y <= -1.9e-40)
		tmp = Float64(b * Float64(y0 * Float64(k * z)));
	elseif (y <= -3.8e-306)
		tmp = Float64(b * Float64(-1.0 * Float64(a * Float64(t * z))));
	elseif (y <= 2.9e+85)
		tmp = Float64(i * Float64(k * Float64(-1.0 * Float64(y1 * z))));
	elseif (y <= 1.35e+155)
		tmp = Float64(b * Float64(t * Float64(-1.0 * Float64(a * z))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = -((i * y) * c) * x;
	tmp = 0.0;
	if (y <= -5.2e+134)
		tmp = t_1;
	elseif (y <= -1.9e-40)
		tmp = b * (y0 * (k * z));
	elseif (y <= -3.8e-306)
		tmp = b * (-1.0 * (a * (t * z)));
	elseif (y <= 2.9e+85)
		tmp = i * (k * (-1.0 * (y1 * z)));
	elseif (y <= 1.35e+155)
		tmp = b * (t * (-1.0 * (a * z)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[((-N[(N[(i * y), $MachinePrecision] * c), $MachinePrecision]) * x), $MachinePrecision]}, If[LessEqual[y, -5.2e+134], t$95$1, If[LessEqual[y, -1.9e-40], N[(b * N[(y0 * N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-306], N[(b * N[(-1.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+85], N[(i * N[(k * N[(-1.0 * N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+155], N[(b * N[(t * N[(-1.0 * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-40}:\\
\;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-306}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+85}:\\
\;\;\;\;i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right)\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{+155}:\\
\;\;\;\;b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.2000000000000003e134 or 1.34999999999999997e155 < y

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in i around -inf

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \color{blue}{\left(c \cdot y - j \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - \color{blue}{j \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.2

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.2%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
      2. lower-*.f6416.9

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
    10. Applied rewrites16.9%

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
      3. lower-*.f6416.9

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
    12. Applied rewrites16.9%

      \[\leadsto \left(-\left(i \cdot y\right) \cdot c\right) \cdot \color{blue}{x} \]

    if -5.2000000000000003e134 < y < -1.8999999999999999e-40

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - \color{blue}{j \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
      4. lower-*.f6426.5

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.6

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    10. Applied rewrites16.6%

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]

    if -1.8999999999999999e-40 < y < -3.8e-306

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around inf

      \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \color{blue}{\left(t \cdot z\right)}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right) \]
      3. lower-*.f6417.3

        \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right) \]
    10. Applied rewrites17.3%

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

    if -3.8e-306 < y < 2.89999999999999997e85

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around 0

      \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot \color{blue}{z}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right) \]
      2. lower-*.f6417.0

        \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right) \]
    10. Applied rewrites17.0%

      \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot \color{blue}{z}\right)\right)\right) \]

    if 2.89999999999999997e85 < y < 1.34999999999999997e155

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around inf

      \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot \color{blue}{z}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right) \]
      2. lower-*.f6417.0

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right)\right)\right) \]
    10. Applied rewrites17.0%

      \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot \color{blue}{z}\right)\right)\right) \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 23: 21.9% accurate, 7.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{+42}:\\ \;\;\;\;i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= x -3.8e+42)
   (* i (* y1 (- (* j x) (* k z))))
   (* i (* k (- (* y y5) (* y1 z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (x <= -3.8e+42) {
		tmp = i * (y1 * ((j * x) - (k * z)));
	} else {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (x <= (-3.8d+42)) then
        tmp = i * (y1 * ((j * x) - (k * z)))
    else
        tmp = i * (k * ((y * y5) - (y1 * z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (x <= -3.8e+42) {
		tmp = i * (y1 * ((j * x) - (k * z)));
	} else {
		tmp = i * (k * ((y * y5) - (y1 * z)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if x <= -3.8e+42:
		tmp = i * (y1 * ((j * x) - (k * z)))
	else:
		tmp = i * (k * ((y * y5) - (y1 * z)))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (x <= -3.8e+42)
		tmp = Float64(i * Float64(y1 * Float64(Float64(j * x) - Float64(k * z))));
	else
		tmp = Float64(i * Float64(k * Float64(Float64(y * y5) - Float64(y1 * z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (x <= -3.8e+42)
		tmp = i * (y1 * ((j * x) - (k * z)));
	else
		tmp = i * (k * ((y * y5) - (y1 * z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[x, -3.8e+42], N[(i * N[(y1 * N[(N[(j * x), $MachinePrecision] - N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(k * N[(N[(y * y5), $MachinePrecision] - N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+42}:\\
\;\;\;\;i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7999999999999998e42

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in y1 around -inf

      \[\leadsto i \cdot \color{blue}{\left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \color{blue}{\left(j \cdot x - k \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - \color{blue}{k \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right) \]
      5. lower-*.f6426.5

        \[\leadsto i \cdot \left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto i \cdot \color{blue}{\left(y1 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]

    if -3.7999999999999998e42 < x

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 24: 21.9% accurate, 4.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{+134}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-40}:\\ \;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-306}:\\ \;\;\;\;b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+124}:\\ \;\;\;\;i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* (- (* (* i y) c)) x)))
   (if (<= y -5.2e+134)
     t_1
     (if (<= y -1.9e-40)
       (* b (* y0 (* k z)))
       (if (<= y -3.8e-306)
         (* b (* -1.0 (* a (* t z))))
         (if (<= y 2.2e+124) (* i (* k (* -1.0 (* y1 z)))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = -((i * y) * c) * x;
	double tmp;
	if (y <= -5.2e+134) {
		tmp = t_1;
	} else if (y <= -1.9e-40) {
		tmp = b * (y0 * (k * z));
	} else if (y <= -3.8e-306) {
		tmp = b * (-1.0 * (a * (t * z)));
	} else if (y <= 2.2e+124) {
		tmp = i * (k * (-1.0 * (y1 * z)));
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -((i * y) * c) * x
    if (y <= (-5.2d+134)) then
        tmp = t_1
    else if (y <= (-1.9d-40)) then
        tmp = b * (y0 * (k * z))
    else if (y <= (-3.8d-306)) then
        tmp = b * ((-1.0d0) * (a * (t * z)))
    else if (y <= 2.2d+124) then
        tmp = i * (k * ((-1.0d0) * (y1 * z)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = -((i * y) * c) * x;
	double tmp;
	if (y <= -5.2e+134) {
		tmp = t_1;
	} else if (y <= -1.9e-40) {
		tmp = b * (y0 * (k * z));
	} else if (y <= -3.8e-306) {
		tmp = b * (-1.0 * (a * (t * z)));
	} else if (y <= 2.2e+124) {
		tmp = i * (k * (-1.0 * (y1 * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = -((i * y) * c) * x
	tmp = 0
	if y <= -5.2e+134:
		tmp = t_1
	elif y <= -1.9e-40:
		tmp = b * (y0 * (k * z))
	elif y <= -3.8e-306:
		tmp = b * (-1.0 * (a * (t * z)))
	elif y <= 2.2e+124:
		tmp = i * (k * (-1.0 * (y1 * z)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(-Float64(Float64(i * y) * c)) * x)
	tmp = 0.0
	if (y <= -5.2e+134)
		tmp = t_1;
	elseif (y <= -1.9e-40)
		tmp = Float64(b * Float64(y0 * Float64(k * z)));
	elseif (y <= -3.8e-306)
		tmp = Float64(b * Float64(-1.0 * Float64(a * Float64(t * z))));
	elseif (y <= 2.2e+124)
		tmp = Float64(i * Float64(k * Float64(-1.0 * Float64(y1 * z))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = -((i * y) * c) * x;
	tmp = 0.0;
	if (y <= -5.2e+134)
		tmp = t_1;
	elseif (y <= -1.9e-40)
		tmp = b * (y0 * (k * z));
	elseif (y <= -3.8e-306)
		tmp = b * (-1.0 * (a * (t * z)));
	elseif (y <= 2.2e+124)
		tmp = i * (k * (-1.0 * (y1 * z)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[((-N[(N[(i * y), $MachinePrecision] * c), $MachinePrecision]) * x), $MachinePrecision]}, If[LessEqual[y, -5.2e+134], t$95$1, If[LessEqual[y, -1.9e-40], N[(b * N[(y0 * N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.8e-306], N[(b * N[(-1.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+124], N[(i * N[(k * N[(-1.0 * N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-40}:\\
\;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-306}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right)\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+124}:\\
\;\;\;\;i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.2000000000000003e134 or 2.2000000000000001e124 < y

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in i around -inf

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \color{blue}{\left(c \cdot y - j \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - \color{blue}{j \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.2

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.2%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
      2. lower-*.f6416.9

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
    10. Applied rewrites16.9%

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
      3. lower-*.f6416.9

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
    12. Applied rewrites16.9%

      \[\leadsto \left(-\left(i \cdot y\right) \cdot c\right) \cdot \color{blue}{x} \]

    if -5.2000000000000003e134 < y < -1.8999999999999999e-40

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - \color{blue}{j \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
      4. lower-*.f6426.5

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.6

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    10. Applied rewrites16.6%

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]

    if -1.8999999999999999e-40 < y < -3.8e-306

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around inf

      \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \color{blue}{\left(t \cdot z\right)}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right) \]
      3. lower-*.f6417.3

        \[\leadsto b \cdot \left(-1 \cdot \left(a \cdot \left(t \cdot z\right)\right)\right) \]
    10. Applied rewrites17.3%

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

    if -3.8e-306 < y < 2.2000000000000001e124

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around 0

      \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot \color{blue}{z}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right) \]
      2. lower-*.f6417.0

        \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right) \]
    10. Applied rewrites17.0%

      \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot \color{blue}{z}\right)\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 25: 21.7% accurate, 4.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{+134}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-129}:\\ \;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-116}:\\ \;\;\;\;b \cdot \left(j \cdot \left(t \cdot y4\right)\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+124}:\\ \;\;\;\;i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* (- (* (* i y) c)) x)))
   (if (<= y -5.2e+134)
     t_1
     (if (<= y -3.5e-129)
       (* b (* y0 (* k z)))
       (if (<= y 2.05e-116)
         (* b (* j (* t y4)))
         (if (<= y 2.2e+124) (* i (* k (* -1.0 (* y1 z)))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = -((i * y) * c) * x;
	double tmp;
	if (y <= -5.2e+134) {
		tmp = t_1;
	} else if (y <= -3.5e-129) {
		tmp = b * (y0 * (k * z));
	} else if (y <= 2.05e-116) {
		tmp = b * (j * (t * y4));
	} else if (y <= 2.2e+124) {
		tmp = i * (k * (-1.0 * (y1 * z)));
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -((i * y) * c) * x
    if (y <= (-5.2d+134)) then
        tmp = t_1
    else if (y <= (-3.5d-129)) then
        tmp = b * (y0 * (k * z))
    else if (y <= 2.05d-116) then
        tmp = b * (j * (t * y4))
    else if (y <= 2.2d+124) then
        tmp = i * (k * ((-1.0d0) * (y1 * z)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = -((i * y) * c) * x;
	double tmp;
	if (y <= -5.2e+134) {
		tmp = t_1;
	} else if (y <= -3.5e-129) {
		tmp = b * (y0 * (k * z));
	} else if (y <= 2.05e-116) {
		tmp = b * (j * (t * y4));
	} else if (y <= 2.2e+124) {
		tmp = i * (k * (-1.0 * (y1 * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = -((i * y) * c) * x
	tmp = 0
	if y <= -5.2e+134:
		tmp = t_1
	elif y <= -3.5e-129:
		tmp = b * (y0 * (k * z))
	elif y <= 2.05e-116:
		tmp = b * (j * (t * y4))
	elif y <= 2.2e+124:
		tmp = i * (k * (-1.0 * (y1 * z)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(Float64(-Float64(Float64(i * y) * c)) * x)
	tmp = 0.0
	if (y <= -5.2e+134)
		tmp = t_1;
	elseif (y <= -3.5e-129)
		tmp = Float64(b * Float64(y0 * Float64(k * z)));
	elseif (y <= 2.05e-116)
		tmp = Float64(b * Float64(j * Float64(t * y4)));
	elseif (y <= 2.2e+124)
		tmp = Float64(i * Float64(k * Float64(-1.0 * Float64(y1 * z))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = -((i * y) * c) * x;
	tmp = 0.0;
	if (y <= -5.2e+134)
		tmp = t_1;
	elseif (y <= -3.5e-129)
		tmp = b * (y0 * (k * z));
	elseif (y <= 2.05e-116)
		tmp = b * (j * (t * y4));
	elseif (y <= 2.2e+124)
		tmp = i * (k * (-1.0 * (y1 * z)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[((-N[(N[(i * y), $MachinePrecision] * c), $MachinePrecision]) * x), $MachinePrecision]}, If[LessEqual[y, -5.2e+134], t$95$1, If[LessEqual[y, -3.5e-129], N[(b * N[(y0 * N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-116], N[(b * N[(j * N[(t * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+124], N[(i * N[(k * N[(-1.0 * N[(y1 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.5 \cdot 10^{-129}:\\
\;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{-116}:\\
\;\;\;\;b \cdot \left(j \cdot \left(t \cdot y4\right)\right)\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+124}:\\
\;\;\;\;i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.2000000000000003e134 or 2.2000000000000001e124 < y

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in i around -inf

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \color{blue}{\left(c \cdot y - j \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - \color{blue}{j \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.2

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.2%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
      2. lower-*.f6416.9

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
    10. Applied rewrites16.9%

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
      3. lower-*.f6416.9

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
    12. Applied rewrites16.9%

      \[\leadsto \left(-\left(i \cdot y\right) \cdot c\right) \cdot \color{blue}{x} \]

    if -5.2000000000000003e134 < y < -3.4999999999999997e-129

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - \color{blue}{j \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
      4. lower-*.f6426.5

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.6

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    10. Applied rewrites16.6%

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]

    if -3.4999999999999997e-129 < y < 2.0499999999999999e-116

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around 0

      \[\leadsto b \cdot \left(j \cdot \left(t \cdot \color{blue}{y4}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(j \cdot \left(t \cdot y4\right)\right) \]
      2. lower-*.f6416.8

        \[\leadsto b \cdot \left(j \cdot \left(t \cdot y4\right)\right) \]
    10. Applied rewrites16.8%

      \[\leadsto b \cdot \left(j \cdot \left(t \cdot \color{blue}{y4}\right)\right) \]

    if 2.0499999999999999e-116 < y < 2.2000000000000001e124

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around 0

      \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot \color{blue}{z}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right) \]
      2. lower-*.f6417.0

        \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot z\right)\right)\right) \]
    10. Applied rewrites17.0%

      \[\leadsto i \cdot \left(k \cdot \left(-1 \cdot \left(y1 \cdot \color{blue}{z}\right)\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 26: 21.5% accurate, 6.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right)\\ \mathbf{if}\;y3 \leq -2.6 \cdot 10^{+213}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y3 \leq 1.9 \cdot 10^{-239}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\ \mathbf{elif}\;y3 \leq 21500000:\\ \;\;\;\;\left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* y0 (* j (* y3 y5)))))
   (if (<= y3 -2.6e+213)
     t_1
     (if (<= y3 1.9e-239)
       (* i (* k (* y y5)))
       (if (<= y3 21500000.0) (* (- (* (* i y) c)) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = y0 * (j * (y3 * y5));
	double tmp;
	if (y3 <= -2.6e+213) {
		tmp = t_1;
	} else if (y3 <= 1.9e-239) {
		tmp = i * (k * (y * y5));
	} else if (y3 <= 21500000.0) {
		tmp = -((i * y) * c) * x;
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y0 * (j * (y3 * y5))
    if (y3 <= (-2.6d+213)) then
        tmp = t_1
    else if (y3 <= 1.9d-239) then
        tmp = i * (k * (y * y5))
    else if (y3 <= 21500000.0d0) then
        tmp = -((i * y) * c) * x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = y0 * (j * (y3 * y5));
	double tmp;
	if (y3 <= -2.6e+213) {
		tmp = t_1;
	} else if (y3 <= 1.9e-239) {
		tmp = i * (k * (y * y5));
	} else if (y3 <= 21500000.0) {
		tmp = -((i * y) * c) * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = y0 * (j * (y3 * y5))
	tmp = 0
	if y3 <= -2.6e+213:
		tmp = t_1
	elif y3 <= 1.9e-239:
		tmp = i * (k * (y * y5))
	elif y3 <= 21500000.0:
		tmp = -((i * y) * c) * x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(y0 * Float64(j * Float64(y3 * y5)))
	tmp = 0.0
	if (y3 <= -2.6e+213)
		tmp = t_1;
	elseif (y3 <= 1.9e-239)
		tmp = Float64(i * Float64(k * Float64(y * y5)));
	elseif (y3 <= 21500000.0)
		tmp = Float64(Float64(-Float64(Float64(i * y) * c)) * x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = y0 * (j * (y3 * y5));
	tmp = 0.0;
	if (y3 <= -2.6e+213)
		tmp = t_1;
	elseif (y3 <= 1.9e-239)
		tmp = i * (k * (y * y5));
	elseif (y3 <= 21500000.0)
		tmp = -((i * y) * c) * x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(y0 * N[(j * N[(y3 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y3, -2.6e+213], t$95$1, If[LessEqual[y3, 1.9e-239], N[(i * N[(k * N[(y * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y3, 21500000.0], N[((-N[(N[(i * y), $MachinePrecision] * c), $MachinePrecision]) * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right)\\
\mathbf{if}\;y3 \leq -2.6 \cdot 10^{+213}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y3 \leq 1.9 \cdot 10^{-239}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\

\mathbf{elif}\;y3 \leq 21500000:\\
\;\;\;\;\left(-\left(i \cdot y\right) \cdot c\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y3 < -2.59999999999999999e213 or 2.15e7 < y3

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y0 around inf

      \[\leadsto \color{blue}{y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \color{blue}{\left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - \color{blue}{b \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot \left(k \cdot y2 - j \cdot y3\right), c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto y0 \cdot \left(j \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - \color{blue}{b \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
      4. lower-*.f6427.6

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
    7. Applied rewrites27.6%

      \[\leadsto y0 \cdot \left(j \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6417.8

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]
    10. Applied rewrites17.8%

      \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]

    if -2.59999999999999999e213 < y3 < 1.9000000000000001e-239

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around inf

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]

    if 1.9000000000000001e-239 < y3 < 2.15e7

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in i around -inf

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \color{blue}{\left(c \cdot y - j \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - \color{blue}{j \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.2

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.2%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in y around inf

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
      2. lower-*.f6416.9

        \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \]
    10. Applied rewrites16.9%

      \[\leadsto x \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot \color{blue}{y}\right)\right)\right) \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
      3. lower-*.f6416.9

        \[\leadsto \left(-1 \cdot \left(c \cdot \left(i \cdot y\right)\right)\right) \cdot \color{blue}{x} \]
    12. Applied rewrites16.9%

      \[\leadsto \left(-\left(i \cdot y\right) \cdot c\right) \cdot \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 27: 21.4% accurate, 6.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\ \mathbf{if}\;y \leq -3.1 \cdot 10^{+121}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-129}:\\ \;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 26000:\\ \;\;\;\;b \cdot \left(j \cdot \left(t \cdot y4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* i (* k (* y y5)))))
   (if (<= y -3.1e+121)
     t_1
     (if (<= y -3.5e-129)
       (* b (* y0 (* k z)))
       (if (<= y 26000.0) (* b (* j (* t y4))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = i * (k * (y * y5));
	double tmp;
	if (y <= -3.1e+121) {
		tmp = t_1;
	} else if (y <= -3.5e-129) {
		tmp = b * (y0 * (k * z));
	} else if (y <= 26000.0) {
		tmp = b * (j * (t * y4));
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = i * (k * (y * y5))
    if (y <= (-3.1d+121)) then
        tmp = t_1
    else if (y <= (-3.5d-129)) then
        tmp = b * (y0 * (k * z))
    else if (y <= 26000.0d0) then
        tmp = b * (j * (t * y4))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = i * (k * (y * y5));
	double tmp;
	if (y <= -3.1e+121) {
		tmp = t_1;
	} else if (y <= -3.5e-129) {
		tmp = b * (y0 * (k * z));
	} else if (y <= 26000.0) {
		tmp = b * (j * (t * y4));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = i * (k * (y * y5))
	tmp = 0
	if y <= -3.1e+121:
		tmp = t_1
	elif y <= -3.5e-129:
		tmp = b * (y0 * (k * z))
	elif y <= 26000.0:
		tmp = b * (j * (t * y4))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(i * Float64(k * Float64(y * y5)))
	tmp = 0.0
	if (y <= -3.1e+121)
		tmp = t_1;
	elseif (y <= -3.5e-129)
		tmp = Float64(b * Float64(y0 * Float64(k * z)));
	elseif (y <= 26000.0)
		tmp = Float64(b * Float64(j * Float64(t * y4)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = i * (k * (y * y5));
	tmp = 0.0;
	if (y <= -3.1e+121)
		tmp = t_1;
	elseif (y <= -3.5e-129)
		tmp = b * (y0 * (k * z));
	elseif (y <= 26000.0)
		tmp = b * (j * (t * y4));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(i * N[(k * N[(y * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e+121], t$95$1, If[LessEqual[y, -3.5e-129], N[(b * N[(y0 * N[(k * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 26000.0], N[(b * N[(j * N[(t * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.5 \cdot 10^{-129}:\\
\;\;\;\;b \cdot \left(y0 \cdot \left(k \cdot z\right)\right)\\

\mathbf{elif}\;y \leq 26000:\\
\;\;\;\;b \cdot \left(j \cdot \left(t \cdot y4\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.10000000000000008e121 or 26000 < y

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around inf

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]

    if -3.10000000000000008e121 < y < -3.4999999999999997e-129

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - \color{blue}{j \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
      4. lower-*.f6426.5

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.6

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]
    10. Applied rewrites16.6%

      \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z\right)\right) \]

    if -3.4999999999999997e-129 < y < 26000

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around 0

      \[\leadsto b \cdot \left(j \cdot \left(t \cdot \color{blue}{y4}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(j \cdot \left(t \cdot y4\right)\right) \]
      2. lower-*.f6416.8

        \[\leadsto b \cdot \left(j \cdot \left(t \cdot y4\right)\right) \]
    10. Applied rewrites16.8%

      \[\leadsto b \cdot \left(j \cdot \left(t \cdot \color{blue}{y4}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 28: 21.4% accurate, 6.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\ \mathbf{if}\;y \leq -2.8 \cdot 10^{+121}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-129}:\\ \;\;\;\;b \cdot \left(k \cdot \left(y0 \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 26000:\\ \;\;\;\;b \cdot \left(j \cdot \left(t \cdot y4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* i (* k (* y y5)))))
   (if (<= y -2.8e+121)
     t_1
     (if (<= y -3.2e-129)
       (* b (* k (* y0 z)))
       (if (<= y 26000.0) (* b (* j (* t y4))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = i * (k * (y * y5));
	double tmp;
	if (y <= -2.8e+121) {
		tmp = t_1;
	} else if (y <= -3.2e-129) {
		tmp = b * (k * (y0 * z));
	} else if (y <= 26000.0) {
		tmp = b * (j * (t * y4));
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = i * (k * (y * y5))
    if (y <= (-2.8d+121)) then
        tmp = t_1
    else if (y <= (-3.2d-129)) then
        tmp = b * (k * (y0 * z))
    else if (y <= 26000.0d0) then
        tmp = b * (j * (t * y4))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = i * (k * (y * y5));
	double tmp;
	if (y <= -2.8e+121) {
		tmp = t_1;
	} else if (y <= -3.2e-129) {
		tmp = b * (k * (y0 * z));
	} else if (y <= 26000.0) {
		tmp = b * (j * (t * y4));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = i * (k * (y * y5))
	tmp = 0
	if y <= -2.8e+121:
		tmp = t_1
	elif y <= -3.2e-129:
		tmp = b * (k * (y0 * z))
	elif y <= 26000.0:
		tmp = b * (j * (t * y4))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(i * Float64(k * Float64(y * y5)))
	tmp = 0.0
	if (y <= -2.8e+121)
		tmp = t_1;
	elseif (y <= -3.2e-129)
		tmp = Float64(b * Float64(k * Float64(y0 * z)));
	elseif (y <= 26000.0)
		tmp = Float64(b * Float64(j * Float64(t * y4)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = i * (k * (y * y5));
	tmp = 0.0;
	if (y <= -2.8e+121)
		tmp = t_1;
	elseif (y <= -3.2e-129)
		tmp = b * (k * (y0 * z));
	elseif (y <= 26000.0)
		tmp = b * (j * (t * y4));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(i * N[(k * N[(y * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e+121], t$95$1, If[LessEqual[y, -3.2e-129], N[(b * N[(k * N[(y0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 26000.0], N[(b * N[(j * N[(t * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.2 \cdot 10^{-129}:\\
\;\;\;\;b \cdot \left(k \cdot \left(y0 \cdot z\right)\right)\\

\mathbf{elif}\;y \leq 26000:\\
\;\;\;\;b \cdot \left(j \cdot \left(t \cdot y4\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.80000000000000006e121 or 26000 < y

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around inf

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]

    if -2.80000000000000006e121 < y < -3.2000000000000003e-129

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - \color{blue}{j \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
      4. lower-*.f6426.5

        \[\leadsto b \cdot \left(y0 \cdot \left(k \cdot z - j \cdot x\right)\right) \]
    7. Applied rewrites26.5%

      \[\leadsto b \cdot \left(y0 \cdot \color{blue}{\left(k \cdot z - j \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto b \cdot \left(k \cdot \left(y0 \cdot \color{blue}{z}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(k \cdot \left(y0 \cdot z\right)\right) \]
      2. lower-*.f6416.6

        \[\leadsto b \cdot \left(k \cdot \left(y0 \cdot z\right)\right) \]
    10. Applied rewrites16.6%

      \[\leadsto b \cdot \left(k \cdot \left(y0 \cdot \color{blue}{z}\right)\right) \]

    if -3.2000000000000003e-129 < y < 26000

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around 0

      \[\leadsto b \cdot \left(j \cdot \left(t \cdot \color{blue}{y4}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(j \cdot \left(t \cdot y4\right)\right) \]
      2. lower-*.f6416.8

        \[\leadsto b \cdot \left(j \cdot \left(t \cdot y4\right)\right) \]
    10. Applied rewrites16.8%

      \[\leadsto b \cdot \left(j \cdot \left(t \cdot \color{blue}{y4}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 29: 21.3% accurate, 7.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;j \leq -4.4 \cdot 10^{+175}:\\ \;\;\;\;x \cdot \left(i \cdot \left(j \cdot y1\right)\right)\\ \mathbf{elif}\;j \leq 1.5 \cdot 10^{-33}:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= j -4.4e+175)
   (* x (* i (* j y1)))
   (if (<= j 1.5e-33) (* i (* k (* y y5))) (* y0 (* j (* y3 y5))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (j <= -4.4e+175) {
		tmp = x * (i * (j * y1));
	} else if (j <= 1.5e-33) {
		tmp = i * (k * (y * y5));
	} else {
		tmp = y0 * (j * (y3 * y5));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (j <= (-4.4d+175)) then
        tmp = x * (i * (j * y1))
    else if (j <= 1.5d-33) then
        tmp = i * (k * (y * y5))
    else
        tmp = y0 * (j * (y3 * y5))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (j <= -4.4e+175) {
		tmp = x * (i * (j * y1));
	} else if (j <= 1.5e-33) {
		tmp = i * (k * (y * y5));
	} else {
		tmp = y0 * (j * (y3 * y5));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if j <= -4.4e+175:
		tmp = x * (i * (j * y1))
	elif j <= 1.5e-33:
		tmp = i * (k * (y * y5))
	else:
		tmp = y0 * (j * (y3 * y5))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (j <= -4.4e+175)
		tmp = Float64(x * Float64(i * Float64(j * y1)));
	elseif (j <= 1.5e-33)
		tmp = Float64(i * Float64(k * Float64(y * y5)));
	else
		tmp = Float64(y0 * Float64(j * Float64(y3 * y5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (j <= -4.4e+175)
		tmp = x * (i * (j * y1));
	elseif (j <= 1.5e-33)
		tmp = i * (k * (y * y5));
	else
		tmp = y0 * (j * (y3 * y5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[j, -4.4e+175], N[(x * N[(i * N[(j * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.5e-33], N[(i * N[(k * N[(y * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y0 * N[(j * N[(y3 * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;j \leq -4.4 \cdot 10^{+175}:\\
\;\;\;\;x \cdot \left(i \cdot \left(j \cdot y1\right)\right)\\

\mathbf{elif}\;j \leq 1.5 \cdot 10^{-33}:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -4.3999999999999999e175

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in i around -inf

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \color{blue}{\left(c \cdot y - j \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - \color{blue}{j \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.2

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.2%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in y around 0

      \[\leadsto x \cdot \left(i \cdot \left(j \cdot \color{blue}{y1}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(i \cdot \left(j \cdot y1\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto x \cdot \left(i \cdot \left(j \cdot y1\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto x \cdot \left(i \cdot \left(j \cdot \color{blue}{y1}\right)\right) \]

    if -4.3999999999999999e175 < j < 1.5000000000000001e-33

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around inf

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]

    if 1.5000000000000001e-33 < j

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in y0 around inf

      \[\leadsto \color{blue}{y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \color{blue}{\left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(\left(-1 \cdot \left(y5 \cdot \left(k \cdot y2 - j \cdot y3\right)\right) + c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - \color{blue}{b \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites37.2%

      \[\leadsto \color{blue}{y0 \cdot \left(\mathsf{fma}\left(-1, y5 \cdot \left(k \cdot y2 - j \cdot y3\right), c \cdot \left(x \cdot y2 - y3 \cdot z\right)\right) - b \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    5. Taylor expanded in j around inf

      \[\leadsto y0 \cdot \left(j \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - \color{blue}{b \cdot x}\right)\right) \]
      2. lower--.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot \color{blue}{x}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
      4. lower-*.f6427.6

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5 - b \cdot x\right)\right) \]
    7. Applied rewrites27.6%

      \[\leadsto y0 \cdot \left(j \cdot \color{blue}{\left(y3 \cdot y5 - b \cdot x\right)}\right) \]
    8. Taylor expanded in x around 0

      \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6417.8

        \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]
    10. Applied rewrites17.8%

      \[\leadsto y0 \cdot \left(j \cdot \left(y3 \cdot y5\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 30: 21.2% accurate, 7.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;j \leq -4.4 \cdot 10^{+175}:\\ \;\;\;\;x \cdot \left(i \cdot \left(j \cdot y1\right)\right)\\ \mathbf{elif}\;j \leq 31.5:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(t \cdot \left(j \cdot y4\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (if (<= j -4.4e+175)
   (* x (* i (* j y1)))
   (if (<= j 31.5) (* i (* k (* y y5))) (* b (* t (* j y4))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (j <= -4.4e+175) {
		tmp = x * (i * (j * y1));
	} else if (j <= 31.5) {
		tmp = i * (k * (y * y5));
	} else {
		tmp = b * (t * (j * y4));
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: tmp
    if (j <= (-4.4d+175)) then
        tmp = x * (i * (j * y1))
    else if (j <= 31.5d0) then
        tmp = i * (k * (y * y5))
    else
        tmp = b * (t * (j * y4))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double tmp;
	if (j <= -4.4e+175) {
		tmp = x * (i * (j * y1));
	} else if (j <= 31.5) {
		tmp = i * (k * (y * y5));
	} else {
		tmp = b * (t * (j * y4));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	tmp = 0
	if j <= -4.4e+175:
		tmp = x * (i * (j * y1))
	elif j <= 31.5:
		tmp = i * (k * (y * y5))
	else:
		tmp = b * (t * (j * y4))
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0
	if (j <= -4.4e+175)
		tmp = Float64(x * Float64(i * Float64(j * y1)));
	elseif (j <= 31.5)
		tmp = Float64(i * Float64(k * Float64(y * y5)));
	else
		tmp = Float64(b * Float64(t * Float64(j * y4)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = 0.0;
	if (j <= -4.4e+175)
		tmp = x * (i * (j * y1));
	elseif (j <= 31.5)
		tmp = i * (k * (y * y5));
	else
		tmp = b * (t * (j * y4));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := If[LessEqual[j, -4.4e+175], N[(x * N[(i * N[(j * y1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 31.5], N[(i * N[(k * N[(y * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(t * N[(j * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;j \leq -4.4 \cdot 10^{+175}:\\
\;\;\;\;x \cdot \left(i \cdot \left(j \cdot y1\right)\right)\\

\mathbf{elif}\;j \leq 31.5:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(t \cdot \left(j \cdot y4\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if j < -4.3999999999999999e175

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto x \cdot \left(\left(y \cdot \left(a \cdot b - c \cdot i\right) + y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - \color{blue}{j \cdot \left(b \cdot y0 - i \cdot y1\right)}\right) \]
    4. Applied rewrites38.2%

      \[\leadsto \color{blue}{x \cdot \left(\mathsf{fma}\left(y, a \cdot b - c \cdot i, y2 \cdot \left(c \cdot y0 - a \cdot y1\right)\right) - j \cdot \left(b \cdot y0 - i \cdot y1\right)\right)} \]
    5. Taylor expanded in i around -inf

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \color{blue}{\left(c \cdot y - j \cdot y1\right)}\right)\right) \]
      2. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - \color{blue}{j \cdot y1}\right)\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot \color{blue}{y1}\right)\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
      5. lower-*.f6426.2

        \[\leadsto x \cdot \left(-1 \cdot \left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)\right) \]
    7. Applied rewrites26.2%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\left(i \cdot \left(c \cdot y - j \cdot y1\right)\right)}\right) \]
    8. Taylor expanded in y around 0

      \[\leadsto x \cdot \left(i \cdot \left(j \cdot \color{blue}{y1}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \left(i \cdot \left(j \cdot y1\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto x \cdot \left(i \cdot \left(j \cdot y1\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto x \cdot \left(i \cdot \left(j \cdot \color{blue}{y1}\right)\right) \]

    if -4.3999999999999999e175 < j < 31.5

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around inf

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]

    if 31.5 < j

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around 0

      \[\leadsto b \cdot \left(t \cdot \left(j \cdot y4\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f6416.8

        \[\leadsto b \cdot \left(t \cdot \left(j \cdot y4\right)\right) \]
    10. Applied rewrites16.8%

      \[\leadsto b \cdot \left(t \cdot \left(j \cdot y4\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 31: 20.5% accurate, 7.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(j \cdot \left(t \cdot y4\right)\right)\\ \mathbf{if}\;j \leq -1.16 \cdot 10^{+155}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;j \leq 31.5:\\ \;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (let* ((t_1 (* b (* j (* t y4)))))
   (if (<= j -1.16e+155) t_1 (if (<= j 31.5) (* i (* k (* y y5))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = b * (j * (t * y4));
	double tmp;
	if (j <= -1.16e+155) {
		tmp = t_1;
	} else if (j <= 31.5) {
		tmp = i * (k * (y * y5));
	} else {
		tmp = t_1;
	}
	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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    real(8) :: t_1
    real(8) :: tmp
    t_1 = b * (j * (t * y4))
    if (j <= (-1.16d+155)) then
        tmp = t_1
    else if (j <= 31.5d0) then
        tmp = i * (k * (y * y5))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	double t_1 = b * (j * (t * y4));
	double tmp;
	if (j <= -1.16e+155) {
		tmp = t_1;
	} else if (j <= 31.5) {
		tmp = i * (k * (y * y5));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	t_1 = b * (j * (t * y4))
	tmp = 0
	if j <= -1.16e+155:
		tmp = t_1
	elif j <= 31.5:
		tmp = i * (k * (y * y5))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = Float64(b * Float64(j * Float64(t * y4)))
	tmp = 0.0
	if (j <= -1.16e+155)
		tmp = t_1;
	elseif (j <= 31.5)
		tmp = Float64(i * Float64(k * Float64(y * y5)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	t_1 = b * (j * (t * y4));
	tmp = 0.0;
	if (j <= -1.16e+155)
		tmp = t_1;
	elseif (j <= 31.5)
		tmp = i * (k * (y * y5));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := Block[{t$95$1 = N[(b * N[(j * N[(t * y4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.16e+155], t$95$1, If[LessEqual[j, 31.5], N[(i * N[(k * N[(y * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(j \cdot \left(t \cdot y4\right)\right)\\
\mathbf{if}\;j \leq -1.16 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;j \leq 31.5:\\
\;\;\;\;i \cdot \left(k \cdot \left(y \cdot y5\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if j < -1.15999999999999992e155 or 31.5 < j

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in b around inf

      \[\leadsto \color{blue}{b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - y0 \cdot \left(j \cdot x - k \cdot z\right)\right)} \]
      2. lower--.f64N/A

        \[\leadsto b \cdot \left(\left(a \cdot \left(x \cdot y - t \cdot z\right) + y4 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y0 \cdot \left(j \cdot x - k \cdot z\right)}\right) \]
    4. Applied rewrites36.9%

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

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \left(a \cdot z\right) + j \cdot y4\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \left(-1 \cdot \left(a \cdot z\right) + \color{blue}{j \cdot y4}\right)\right) \]
      2. lower-fma.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot \color{blue}{z}, j \cdot y4\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
      4. lower-*.f6426.4

        \[\leadsto b \cdot \left(t \cdot \mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)\right) \]
    7. Applied rewrites26.4%

      \[\leadsto b \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(-1, a \cdot z, j \cdot y4\right)}\right) \]
    8. Taylor expanded in z around 0

      \[\leadsto b \cdot \left(j \cdot \left(t \cdot \color{blue}{y4}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto b \cdot \left(j \cdot \left(t \cdot y4\right)\right) \]
      2. lower-*.f6416.8

        \[\leadsto b \cdot \left(j \cdot \left(t \cdot y4\right)\right) \]
    10. Applied rewrites16.8%

      \[\leadsto b \cdot \left(j \cdot \left(t \cdot \color{blue}{y4}\right)\right) \]

    if -1.15999999999999992e155 < j < 31.5

    1. Initial program 29.9%

      \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
    2. Taylor expanded in i around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
      3. lower--.f64N/A

        \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
    4. Applied rewrites37.3%

      \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    5. Taylor expanded in k around -inf

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
      2. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
      3. lower--.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
      5. lower-*.f6426.8

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    7. Applied rewrites26.8%

      \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
    8. Taylor expanded in y around inf

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
    9. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
      2. lower-*.f6417.3

        \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
    10. Applied rewrites17.3%

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 32: 17.3% accurate, 13.6× speedup?

\[\begin{array}{l} \\ i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \end{array} \]
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
 :precision binary64
 (* i (* k (* y y5))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	return i * (k * (y * y5));
}
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, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
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), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8), intent (in) :: y0
    real(8), intent (in) :: y1
    real(8), intent (in) :: y2
    real(8), intent (in) :: y3
    real(8), intent (in) :: y4
    real(8), intent (in) :: y5
    code = i * (k * (y * y5))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k, double y0, double y1, double y2, double y3, double y4, double y5) {
	return i * (k * (y * y5));
}
def code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5):
	return i * (k * (y * y5))
function code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	return Float64(i * Float64(k * Float64(y * y5)))
end
function tmp = code(x, y, z, t, a, b, c, i, j, k, y0, y1, y2, y3, y4, y5)
	tmp = i * (k * (y * y5));
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_, y0_, y1_, y2_, y3_, y4_, y5_] := N[(i * N[(k * N[(y * y5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
i \cdot \left(k \cdot \left(y \cdot y5\right)\right)
\end{array}
Derivation
  1. Initial program 29.9%

    \[\left(\left(\left(\left(\left(x \cdot y - z \cdot t\right) \cdot \left(a \cdot b - c \cdot i\right) - \left(x \cdot j - z \cdot k\right) \cdot \left(y0 \cdot b - y1 \cdot i\right)\right) + \left(x \cdot y2 - z \cdot y3\right) \cdot \left(y0 \cdot c - y1 \cdot a\right)\right) + \left(t \cdot j - y \cdot k\right) \cdot \left(y4 \cdot b - y5 \cdot i\right)\right) - \left(t \cdot y2 - y \cdot y3\right) \cdot \left(y4 \cdot c - y5 \cdot a\right)\right) + \left(k \cdot y2 - j \cdot y3\right) \cdot \left(y4 \cdot y1 - y5 \cdot y0\right) \]
  2. Taylor expanded in i around -inf

    \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
    2. lower-*.f64N/A

      \[\leadsto -1 \cdot \left(i \cdot \color{blue}{\left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)}\right) \]
    3. lower--.f64N/A

      \[\leadsto -1 \cdot \left(i \cdot \left(\left(c \cdot \left(x \cdot y - t \cdot z\right) + y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - \color{blue}{y1 \cdot \left(j \cdot x - k \cdot z\right)}\right)\right) \]
  4. Applied rewrites37.3%

    \[\leadsto \color{blue}{-1 \cdot \left(i \cdot \left(\mathsf{fma}\left(c, x \cdot y - t \cdot z, y5 \cdot \left(j \cdot t - k \cdot y\right)\right) - y1 \cdot \left(j \cdot x - k \cdot z\right)\right)\right)} \]
  5. Taylor expanded in k around -inf

    \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto i \cdot \left(k \cdot \color{blue}{\left(y \cdot y5 - y1 \cdot z\right)}\right) \]
    2. lower-*.f64N/A

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - \color{blue}{y1 \cdot z}\right)\right) \]
    3. lower--.f64N/A

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot \color{blue}{z}\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
    5. lower-*.f6426.8

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right) \]
  7. Applied rewrites26.8%

    \[\leadsto i \cdot \color{blue}{\left(k \cdot \left(y \cdot y5 - y1 \cdot z\right)\right)} \]
  8. Taylor expanded in y around inf

    \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
  9. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
    2. lower-*.f6417.3

      \[\leadsto i \cdot \left(k \cdot \left(y \cdot y5\right)\right) \]
  10. Applied rewrites17.3%

    \[\leadsto i \cdot \left(k \cdot \left(y \cdot \color{blue}{y5}\right)\right) \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2025149 
(FPCore (x y z t a b c i j k y0 y1 y2 y3 y4 y5)
  :name "Linear.Matrix:det44 from linear-1.19.1.3"
  :precision binary64
  (+ (- (+ (+ (- (* (- (* x y) (* z t)) (- (* a b) (* c i))) (* (- (* x j) (* z k)) (- (* y0 b) (* y1 i)))) (* (- (* x y2) (* z y3)) (- (* y0 c) (* y1 a)))) (* (- (* t j) (* y k)) (- (* y4 b) (* y5 i)))) (* (- (* t y2) (* y y3)) (- (* y4 c) (* y5 a)))) (* (- (* k y2) (* j y3)) (- (* y4 y1) (* y5 y0)))))