Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A

Percentage Accurate: 99.9% → 99.9%
Time: 19.2s
Alternatives: 20
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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
    code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

\[\begin{array}{l} \\ \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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
    code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(y + \left(x + \left(b \cdot a + b \cdot -0.5\right)\right)\right) - z \cdot \left(\log t + -1\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (- (+ y (+ x (+ (* b a) (* b -0.5)))) (* z (+ (log t) -1.0))))
double code(double x, double y, double z, double t, double a, double b) {
	return (y + (x + ((b * a) + (b * -0.5)))) - (z * (log(t) + -1.0));
}
real(8) function code(x, y, z, t, a, b)
    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
    code = (y + (x + ((b * a) + (b * (-0.5d0))))) - (z * (log(t) + (-1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (y + (x + ((b * a) + (b * -0.5)))) - (z * (Math.log(t) + -1.0));
}
def code(x, y, z, t, a, b):
	return (y + (x + ((b * a) + (b * -0.5)))) - (z * (math.log(t) + -1.0))
function code(x, y, z, t, a, b)
	return Float64(Float64(y + Float64(x + Float64(Float64(b * a) + Float64(b * -0.5)))) - Float64(z * Float64(log(t) + -1.0)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (y + (x + ((b * a) + (b * -0.5)))) - (z * (log(t) + -1.0));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(y + N[(x + N[(N[(b * a), $MachinePrecision] + N[(b * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(N[Log[t], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(y + \left(x + \left(b \cdot a + b \cdot -0.5\right)\right)\right) - z \cdot \left(\log t + -1\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Simplified0

    \[\leadsto expr\]
  3. Add Preprocessing
  4. Applied egg-rr0

    \[\leadsto expr\]
  5. Add Preprocessing

Alternative 2: 93.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.42 \cdot 10^{+103}:\\ \;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{+144}:\\ \;\;\;\;\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + b \cdot a\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(a - 0.5\right) + \frac{z \cdot \left(1 - \log t\right)}{b}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.42e+103)
   (+ (+ y x) (* (- a 0.5) b))
   (if (<= b 2.3e+144)
     (+ (- (+ (+ x y) z) (* z (log t))) (* b a))
     (* b (+ (- a 0.5) (/ (* z (- 1.0 (log t))) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.42e+103) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else if (b <= 2.3e+144) {
		tmp = (((x + y) + z) - (z * log(t))) + (b * a);
	} else {
		tmp = b * ((a - 0.5) + ((z * (1.0 - log(t))) / b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (b <= (-1.42d+103)) then
        tmp = (y + x) + ((a - 0.5d0) * b)
    else if (b <= 2.3d+144) then
        tmp = (((x + y) + z) - (z * log(t))) + (b * a)
    else
        tmp = b * ((a - 0.5d0) + ((z * (1.0d0 - log(t))) / b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.42e+103) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else if (b <= 2.3e+144) {
		tmp = (((x + y) + z) - (z * Math.log(t))) + (b * a);
	} else {
		tmp = b * ((a - 0.5) + ((z * (1.0 - Math.log(t))) / b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -1.42e+103:
		tmp = (y + x) + ((a - 0.5) * b)
	elif b <= 2.3e+144:
		tmp = (((x + y) + z) - (z * math.log(t))) + (b * a)
	else:
		tmp = b * ((a - 0.5) + ((z * (1.0 - math.log(t))) / b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.42e+103)
		tmp = Float64(Float64(y + x) + Float64(Float64(a - 0.5) * b));
	elseif (b <= 2.3e+144)
		tmp = Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(b * a));
	else
		tmp = Float64(b * Float64(Float64(a - 0.5) + Float64(Float64(z * Float64(1.0 - log(t))) / b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -1.42e+103)
		tmp = (y + x) + ((a - 0.5) * b);
	elseif (b <= 2.3e+144)
		tmp = (((x + y) + z) - (z * log(t))) + (b * a);
	else
		tmp = b * ((a - 0.5) + ((z * (1.0 - log(t))) / b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.42e+103], N[(N[(y + x), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e+144], N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(a - 0.5), $MachinePrecision] + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.42 \cdot 10^{+103}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\

\mathbf{elif}\;b \leq 2.3 \cdot 10^{+144}:\\
\;\;\;\;\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + b \cdot a\\

\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(a - 0.5\right) + \frac{z \cdot \left(1 - \log t\right)}{b}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.42e103

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.42e103 < b < 2.3000000000000001e144

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 2.3000000000000001e144 < b

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 88.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;z \leq -9 \cdot 10^{+114}:\\ \;\;\;\;b \cdot \left(a - 0.5\right) - z \cdot \left(\log t + -1\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+180}:\\ \;\;\;\;\left(y + x\right) + t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(z - z \cdot \log t\right) + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- a 0.5) b)))
   (if (<= z -9e+114)
     (- (* b (- a 0.5)) (* z (+ (log t) -1.0)))
     (if (<= z 7.5e+180) (+ (+ y x) t_1) (+ (- z (* z (log t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (a - 0.5) * b;
	double tmp;
	if (z <= -9e+114) {
		tmp = (b * (a - 0.5)) - (z * (log(t) + -1.0));
	} else if (z <= 7.5e+180) {
		tmp = (y + x) + t_1;
	} else {
		tmp = (z - (z * log(t))) + t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = (a - 0.5d0) * b
    if (z <= (-9d+114)) then
        tmp = (b * (a - 0.5d0)) - (z * (log(t) + (-1.0d0)))
    else if (z <= 7.5d+180) then
        tmp = (y + x) + t_1
    else
        tmp = (z - (z * log(t))) + 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 t_1 = (a - 0.5) * b;
	double tmp;
	if (z <= -9e+114) {
		tmp = (b * (a - 0.5)) - (z * (Math.log(t) + -1.0));
	} else if (z <= 7.5e+180) {
		tmp = (y + x) + t_1;
	} else {
		tmp = (z - (z * Math.log(t))) + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (a - 0.5) * b
	tmp = 0
	if z <= -9e+114:
		tmp = (b * (a - 0.5)) - (z * (math.log(t) + -1.0))
	elif z <= 7.5e+180:
		tmp = (y + x) + t_1
	else:
		tmp = (z - (z * math.log(t))) + t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(a - 0.5) * b)
	tmp = 0.0
	if (z <= -9e+114)
		tmp = Float64(Float64(b * Float64(a - 0.5)) - Float64(z * Float64(log(t) + -1.0)));
	elseif (z <= 7.5e+180)
		tmp = Float64(Float64(y + x) + t_1);
	else
		tmp = Float64(Float64(z - Float64(z * log(t))) + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (a - 0.5) * b;
	tmp = 0.0;
	if (z <= -9e+114)
		tmp = (b * (a - 0.5)) - (z * (log(t) + -1.0));
	elseif (z <= 7.5e+180)
		tmp = (y + x) + t_1;
	else
		tmp = (z - (z * log(t))) + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[z, -9e+114], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - N[(z * N[(N[Log[t], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+180], N[(N[(y + x), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;z \leq -9 \cdot 10^{+114}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) - z \cdot \left(\log t + -1\right)\\

\mathbf{elif}\;z \leq 7.5 \cdot 10^{+180}:\\
\;\;\;\;\left(y + x\right) + t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(z - z \cdot \log t\right) + t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.0000000000000001e114

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -9.0000000000000001e114 < z < 7.5000000000000003e180

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 7.5000000000000003e180 < z

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 88.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ t_2 := \left(z - z \cdot \log t\right) + t\_1\\ \mathbf{if}\;z \leq -3.8 \cdot 10^{+113}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+181}:\\ \;\;\;\;\left(y + x\right) + t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- a 0.5) b)) (t_2 (+ (- z (* z (log t))) t_1)))
   (if (<= z -3.8e+113) t_2 (if (<= z 1.8e+181) (+ (+ y x) t_1) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (a - 0.5) * b;
	double t_2 = (z - (z * log(t))) + t_1;
	double tmp;
	if (z <= -3.8e+113) {
		tmp = t_2;
	} else if (z <= 1.8e+181) {
		tmp = (y + x) + t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a - 0.5d0) * b
    t_2 = (z - (z * log(t))) + t_1
    if (z <= (-3.8d+113)) then
        tmp = t_2
    else if (z <= 1.8d+181) then
        tmp = (y + x) + t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (a - 0.5) * b;
	double t_2 = (z - (z * Math.log(t))) + t_1;
	double tmp;
	if (z <= -3.8e+113) {
		tmp = t_2;
	} else if (z <= 1.8e+181) {
		tmp = (y + x) + t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (a - 0.5) * b
	t_2 = (z - (z * math.log(t))) + t_1
	tmp = 0
	if z <= -3.8e+113:
		tmp = t_2
	elif z <= 1.8e+181:
		tmp = (y + x) + t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(a - 0.5) * b)
	t_2 = Float64(Float64(z - Float64(z * log(t))) + t_1)
	tmp = 0.0
	if (z <= -3.8e+113)
		tmp = t_2;
	elseif (z <= 1.8e+181)
		tmp = Float64(Float64(y + x) + t_1);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (a - 0.5) * b;
	t_2 = (z - (z * log(t))) + t_1;
	tmp = 0.0;
	if (z <= -3.8e+113)
		tmp = t_2;
	elseif (z <= 1.8e+181)
		tmp = (y + x) + t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[z, -3.8e+113], t$95$2, If[LessEqual[z, 1.8e+181], N[(N[(y + x), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := \left(z - z \cdot \log t\right) + t\_1\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+113}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+181}:\\
\;\;\;\;\left(y + x\right) + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8000000000000003e113 or 1.79999999999999992e181 < z

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -3.8000000000000003e113 < z < 1.79999999999999992e181

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 86.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot a - z \cdot \left(\log t + -1\right)\\ \mathbf{if}\;z \leq -7.8 \cdot 10^{+115}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+189}:\\ \;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (* b a) (* z (+ (log t) -1.0)))))
   (if (<= z -7.8e+115)
     t_1
     (if (<= z 1.65e+189) (+ (+ y x) (* (- a 0.5) b)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (b * a) - (z * (log(t) + -1.0));
	double tmp;
	if (z <= -7.8e+115) {
		tmp = t_1;
	} else if (z <= 1.65e+189) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = (b * a) - (z * (log(t) + (-1.0d0)))
    if (z <= (-7.8d+115)) then
        tmp = t_1
    else if (z <= 1.65d+189) then
        tmp = (y + x) + ((a - 0.5d0) * b)
    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 t_1 = (b * a) - (z * (Math.log(t) + -1.0));
	double tmp;
	if (z <= -7.8e+115) {
		tmp = t_1;
	} else if (z <= 1.65e+189) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (b * a) - (z * (math.log(t) + -1.0))
	tmp = 0
	if z <= -7.8e+115:
		tmp = t_1
	elif z <= 1.65e+189:
		tmp = (y + x) + ((a - 0.5) * b)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(b * a) - Float64(z * Float64(log(t) + -1.0)))
	tmp = 0.0
	if (z <= -7.8e+115)
		tmp = t_1;
	elseif (z <= 1.65e+189)
		tmp = Float64(Float64(y + x) + Float64(Float64(a - 0.5) * b));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (b * a) - (z * (log(t) + -1.0));
	tmp = 0.0;
	if (z <= -7.8e+115)
		tmp = t_1;
	elseif (z <= 1.65e+189)
		tmp = (y + x) + ((a - 0.5) * b);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] - N[(z * N[(N[Log[t], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+115], t$95$1, If[LessEqual[z, 1.65e+189], N[(N[(y + x), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot a - z \cdot \left(\log t + -1\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.65 \cdot 10^{+189}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.80000000000000012e115 or 1.6500000000000001e189 < z

    1. Initial program 99.7%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -7.80000000000000012e115 < z < 1.6500000000000001e189

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 83.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.4 \cdot 10^{+177}:\\ \;\;\;\;x - z \cdot \left(\log t + -1\right)\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+252}:\\ \;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -7.4e+177)
   (- x (* z (+ (log t) -1.0)))
   (if (<= z 2e+252) (+ (+ y x) (* (- a 0.5) b)) (* z (- 1.0 (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -7.4e+177) {
		tmp = x - (z * (log(t) + -1.0));
	} else if (z <= 2e+252) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else {
		tmp = z * (1.0 - log(t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-7.4d+177)) then
        tmp = x - (z * (log(t) + (-1.0d0)))
    else if (z <= 2d+252) then
        tmp = (y + x) + ((a - 0.5d0) * b)
    else
        tmp = z * (1.0d0 - log(t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -7.4e+177) {
		tmp = x - (z * (Math.log(t) + -1.0));
	} else if (z <= 2e+252) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else {
		tmp = z * (1.0 - Math.log(t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -7.4e+177:
		tmp = x - (z * (math.log(t) + -1.0))
	elif z <= 2e+252:
		tmp = (y + x) + ((a - 0.5) * b)
	else:
		tmp = z * (1.0 - math.log(t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -7.4e+177)
		tmp = Float64(x - Float64(z * Float64(log(t) + -1.0)));
	elseif (z <= 2e+252)
		tmp = Float64(Float64(y + x) + Float64(Float64(a - 0.5) * b));
	else
		tmp = Float64(z * Float64(1.0 - log(t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -7.4e+177)
		tmp = x - (z * (log(t) + -1.0));
	elseif (z <= 2e+252)
		tmp = (y + x) + ((a - 0.5) * b);
	else
		tmp = z * (1.0 - log(t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.4e+177], N[(x - N[(z * N[(N[Log[t], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+252], N[(N[(y + x), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+177}:\\
\;\;\;\;x - z \cdot \left(\log t + -1\right)\\

\mathbf{elif}\;z \leq 2 \cdot 10^{+252}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.40000000000000028e177

    1. Initial program 99.6%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if -7.40000000000000028e177 < z < 2.0000000000000002e252

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 2.0000000000000002e252 < z

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 84.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+177}:\\ \;\;\;\;\left(x - z \cdot \log t\right) + z\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+252}:\\ \;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -1.5e+177)
   (+ (- x (* z (log t))) z)
   (if (<= z 2e+252) (+ (+ y x) (* (- a 0.5) b)) (* z (- 1.0 (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.5e+177) {
		tmp = (x - (z * log(t))) + z;
	} else if (z <= 2e+252) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else {
		tmp = z * (1.0 - log(t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-1.5d+177)) then
        tmp = (x - (z * log(t))) + z
    else if (z <= 2d+252) then
        tmp = (y + x) + ((a - 0.5d0) * b)
    else
        tmp = z * (1.0d0 - log(t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.5e+177) {
		tmp = (x - (z * Math.log(t))) + z;
	} else if (z <= 2e+252) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else {
		tmp = z * (1.0 - Math.log(t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -1.5e+177:
		tmp = (x - (z * math.log(t))) + z
	elif z <= 2e+252:
		tmp = (y + x) + ((a - 0.5) * b)
	else:
		tmp = z * (1.0 - math.log(t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -1.5e+177)
		tmp = Float64(Float64(x - Float64(z * log(t))) + z);
	elseif (z <= 2e+252)
		tmp = Float64(Float64(y + x) + Float64(Float64(a - 0.5) * b));
	else
		tmp = Float64(z * Float64(1.0 - log(t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -1.5e+177)
		tmp = (x - (z * log(t))) + z;
	elseif (z <= 2e+252)
		tmp = (y + x) + ((a - 0.5) * b);
	else
		tmp = z * (1.0 - log(t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.5e+177], N[(N[(x - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[z, 2e+252], N[(N[(y + x), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+177}:\\
\;\;\;\;\left(x - z \cdot \log t\right) + z\\

\mathbf{elif}\;z \leq 2 \cdot 10^{+252}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.5e177

    1. Initial program 99.6%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Simplified0

      \[\leadsto expr\]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if -1.5e177 < z < 2.0000000000000002e252

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 2.0000000000000002e252 < z

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 83.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(1 - \log t\right)\\ \mathbf{if}\;z \leq -1.4 \cdot 10^{+178}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+253}:\\ \;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (- 1.0 (log t)))))
   (if (<= z -1.4e+178)
     t_1
     (if (<= z 3e+253) (+ (+ y x) (* (- a 0.5) b)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (1.0 - log(t));
	double tmp;
	if (z <= -1.4e+178) {
		tmp = t_1;
	} else if (z <= 3e+253) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = z * (1.0d0 - log(t))
    if (z <= (-1.4d+178)) then
        tmp = t_1
    else if (z <= 3d+253) then
        tmp = (y + x) + ((a - 0.5d0) * b)
    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 t_1 = z * (1.0 - Math.log(t));
	double tmp;
	if (z <= -1.4e+178) {
		tmp = t_1;
	} else if (z <= 3e+253) {
		tmp = (y + x) + ((a - 0.5) * b);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (1.0 - math.log(t))
	tmp = 0
	if z <= -1.4e+178:
		tmp = t_1
	elif z <= 3e+253:
		tmp = (y + x) + ((a - 0.5) * b)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(1.0 - log(t)))
	tmp = 0.0
	if (z <= -1.4e+178)
		tmp = t_1;
	elseif (z <= 3e+253)
		tmp = Float64(Float64(y + x) + Float64(Float64(a - 0.5) * b));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (1.0 - log(t));
	tmp = 0.0;
	if (z <= -1.4e+178)
		tmp = t_1;
	elseif (z <= 3e+253)
		tmp = (y + x) + ((a - 0.5) * b);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+178], t$95$1, If[LessEqual[z, 3e+253], N[(N[(y + x), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+178}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+253}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.39999999999999997e178 or 2.9999999999999998e253 < z

    1. Initial program 99.6%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.39999999999999997e178 < z < 2.9999999999999998e253

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(y + \left(x + \left(a - 0.5\right) \cdot b\right)\right) - z \cdot \left(\log t + -1\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (- (+ y (+ x (* (- a 0.5) b))) (* z (+ (log t) -1.0))))
double code(double x, double y, double z, double t, double a, double b) {
	return (y + (x + ((a - 0.5) * b))) - (z * (log(t) + -1.0));
}
real(8) function code(x, y, z, t, a, b)
    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
    code = (y + (x + ((a - 0.5d0) * b))) - (z * (log(t) + (-1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (y + (x + ((a - 0.5) * b))) - (z * (Math.log(t) + -1.0));
}
def code(x, y, z, t, a, b):
	return (y + (x + ((a - 0.5) * b))) - (z * (math.log(t) + -1.0))
function code(x, y, z, t, a, b)
	return Float64(Float64(y + Float64(x + Float64(Float64(a - 0.5) * b))) - Float64(z * Float64(log(t) + -1.0)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (y + (x + ((a - 0.5) * b))) - (z * (log(t) + -1.0));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(y + N[(x + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(N[Log[t], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(y + \left(x + \left(a - 0.5\right) \cdot b\right)\right) - z \cdot \left(\log t + -1\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Simplified0

    \[\leadsto expr\]
  3. Add Preprocessing
  4. Add Preprocessing

Alternative 10: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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
    code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 11: 61.8% accurate, 3.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;b \leq -6.8 \cdot 10^{+102}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{+65}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;b \leq -2.7 \cdot 10^{+23}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 1.9 \cdot 10^{-10}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{+144}:\\ \;\;\;\;x + b \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= b -6.8e+102)
     t_1
     (if (<= b -1.2e+65)
       (+ x y)
       (if (<= b -2.7e+23)
         t_1
         (if (<= b 1.9e-10)
           (+ x y)
           (if (<= b 1.85e+144) (+ x (* b a)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (b <= -6.8e+102) {
		tmp = t_1;
	} else if (b <= -1.2e+65) {
		tmp = x + y;
	} else if (b <= -2.7e+23) {
		tmp = t_1;
	} else if (b <= 1.9e-10) {
		tmp = x + y;
	} else if (b <= 1.85e+144) {
		tmp = x + (b * a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = b * (a - 0.5d0)
    if (b <= (-6.8d+102)) then
        tmp = t_1
    else if (b <= (-1.2d+65)) then
        tmp = x + y
    else if (b <= (-2.7d+23)) then
        tmp = t_1
    else if (b <= 1.9d-10) then
        tmp = x + y
    else if (b <= 1.85d+144) then
        tmp = x + (b * a)
    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 t_1 = b * (a - 0.5);
	double tmp;
	if (b <= -6.8e+102) {
		tmp = t_1;
	} else if (b <= -1.2e+65) {
		tmp = x + y;
	} else if (b <= -2.7e+23) {
		tmp = t_1;
	} else if (b <= 1.9e-10) {
		tmp = x + y;
	} else if (b <= 1.85e+144) {
		tmp = x + (b * a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if b <= -6.8e+102:
		tmp = t_1
	elif b <= -1.2e+65:
		tmp = x + y
	elif b <= -2.7e+23:
		tmp = t_1
	elif b <= 1.9e-10:
		tmp = x + y
	elif b <= 1.85e+144:
		tmp = x + (b * a)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (b <= -6.8e+102)
		tmp = t_1;
	elseif (b <= -1.2e+65)
		tmp = Float64(x + y);
	elseif (b <= -2.7e+23)
		tmp = t_1;
	elseif (b <= 1.9e-10)
		tmp = Float64(x + y);
	elseif (b <= 1.85e+144)
		tmp = Float64(x + Float64(b * a));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a - 0.5);
	tmp = 0.0;
	if (b <= -6.8e+102)
		tmp = t_1;
	elseif (b <= -1.2e+65)
		tmp = x + y;
	elseif (b <= -2.7e+23)
		tmp = t_1;
	elseif (b <= 1.9e-10)
		tmp = x + y;
	elseif (b <= 1.85e+144)
		tmp = x + (b * a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.8e+102], t$95$1, If[LessEqual[b, -1.2e+65], N[(x + y), $MachinePrecision], If[LessEqual[b, -2.7e+23], t$95$1, If[LessEqual[b, 1.9e-10], N[(x + y), $MachinePrecision], If[LessEqual[b, 1.85e+144], N[(x + N[(b * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -6.8 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -1.2 \cdot 10^{+65}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;b \leq -2.7 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 1.9 \cdot 10^{-10}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;b \leq 1.85 \cdot 10^{+144}:\\
\;\;\;\;x + b \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.8000000000000001e102 or -1.2000000000000001e65 < b < -2.6999999999999999e23 or 1.8499999999999998e144 < b

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -6.8000000000000001e102 < b < -1.2000000000000001e65 or -2.6999999999999999e23 < b < 1.8999999999999999e-10

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in b around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 1.8999999999999999e-10 < b < 1.8499999999999998e144

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 61.2% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;b \leq -8.5 \cdot 10^{+102}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq -3.2 \cdot 10^{+65}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;b \leq -4.5 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{+31}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= b -8.5e+102)
     t_1
     (if (<= b -3.2e+65)
       (+ x y)
       (if (<= b -4.5e+24) t_1 (if (<= b 1.7e+31) (+ x y) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (b <= -8.5e+102) {
		tmp = t_1;
	} else if (b <= -3.2e+65) {
		tmp = x + y;
	} else if (b <= -4.5e+24) {
		tmp = t_1;
	} else if (b <= 1.7e+31) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = b * (a - 0.5d0)
    if (b <= (-8.5d+102)) then
        tmp = t_1
    else if (b <= (-3.2d+65)) then
        tmp = x + y
    else if (b <= (-4.5d+24)) then
        tmp = t_1
    else if (b <= 1.7d+31) then
        tmp = x + y
    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 t_1 = b * (a - 0.5);
	double tmp;
	if (b <= -8.5e+102) {
		tmp = t_1;
	} else if (b <= -3.2e+65) {
		tmp = x + y;
	} else if (b <= -4.5e+24) {
		tmp = t_1;
	} else if (b <= 1.7e+31) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if b <= -8.5e+102:
		tmp = t_1
	elif b <= -3.2e+65:
		tmp = x + y
	elif b <= -4.5e+24:
		tmp = t_1
	elif b <= 1.7e+31:
		tmp = x + y
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (b <= -8.5e+102)
		tmp = t_1;
	elseif (b <= -3.2e+65)
		tmp = Float64(x + y);
	elseif (b <= -4.5e+24)
		tmp = t_1;
	elseif (b <= 1.7e+31)
		tmp = Float64(x + y);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (a - 0.5);
	tmp = 0.0;
	if (b <= -8.5e+102)
		tmp = t_1;
	elseif (b <= -3.2e+65)
		tmp = x + y;
	elseif (b <= -4.5e+24)
		tmp = t_1;
	elseif (b <= 1.7e+31)
		tmp = x + y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8.5e+102], t$95$1, If[LessEqual[b, -3.2e+65], N[(x + y), $MachinePrecision], If[LessEqual[b, -4.5e+24], t$95$1, If[LessEqual[b, 1.7e+31], N[(x + y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -8.5 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -3.2 \cdot 10^{+65}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;b \leq -4.5 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 1.7 \cdot 10^{+31}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -8.4999999999999996e102 or -3.20000000000000007e65 < b < -4.50000000000000019e24 or 1.6999999999999999e31 < b

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -8.4999999999999996e102 < b < -3.20000000000000007e65 or -4.50000000000000019e24 < b < 1.6999999999999999e31

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in b around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 50.7% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + y \leq -4 \cdot 10^{-5}:\\ \;\;\;\;x + b \cdot a\\ \mathbf{elif}\;x + y \leq 10^{+28}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + b \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ x y) -4e-5)
   (+ x (* b a))
   (if (<= (+ x y) 1e+28) (* b (- a 0.5)) (+ y (* b a)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x + y) <= -4e-5) {
		tmp = x + (b * a);
	} else if ((x + y) <= 1e+28) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y + (b * a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if ((x + y) <= (-4d-5)) then
        tmp = x + (b * a)
    else if ((x + y) <= 1d+28) then
        tmp = b * (a - 0.5d0)
    else
        tmp = y + (b * a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x + y) <= -4e-5) {
		tmp = x + (b * a);
	} else if ((x + y) <= 1e+28) {
		tmp = b * (a - 0.5);
	} else {
		tmp = y + (b * a);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (x + y) <= -4e-5:
		tmp = x + (b * a)
	elif (x + y) <= 1e+28:
		tmp = b * (a - 0.5)
	else:
		tmp = y + (b * a)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(x + y) <= -4e-5)
		tmp = Float64(x + Float64(b * a));
	elseif (Float64(x + y) <= 1e+28)
		tmp = Float64(b * Float64(a - 0.5));
	else
		tmp = Float64(y + Float64(b * a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((x + y) <= -4e-5)
		tmp = x + (b * a);
	elseif ((x + y) <= 1e+28)
		tmp = b * (a - 0.5);
	else
		tmp = y + (b * a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -4e-5], N[(x + N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 1e+28], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -4 \cdot 10^{-5}:\\
\;\;\;\;x + b \cdot a\\

\mathbf{elif}\;x + y \leq 10^{+28}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;y + b \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x y) < -4.00000000000000033e-5

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -4.00000000000000033e-5 < (+.f64 x y) < 9.99999999999999958e27

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 9.99999999999999958e27 < (+.f64 x y)

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 36.4% accurate, 6.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{+21}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;b \leq -3 \cdot 10^{-204}:\\ \;\;\;\;y\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{-26}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -7.8e+21)
   (* b a)
   (if (<= b -3e-204) y (if (<= b 4.9e-26) x (* b a)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -7.8e+21) {
		tmp = b * a;
	} else if (b <= -3e-204) {
		tmp = y;
	} else if (b <= 4.9e-26) {
		tmp = x;
	} else {
		tmp = b * a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (b <= (-7.8d+21)) then
        tmp = b * a
    else if (b <= (-3d-204)) then
        tmp = y
    else if (b <= 4.9d-26) then
        tmp = x
    else
        tmp = b * a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -7.8e+21) {
		tmp = b * a;
	} else if (b <= -3e-204) {
		tmp = y;
	} else if (b <= 4.9e-26) {
		tmp = x;
	} else {
		tmp = b * a;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -7.8e+21:
		tmp = b * a
	elif b <= -3e-204:
		tmp = y
	elif b <= 4.9e-26:
		tmp = x
	else:
		tmp = b * a
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -7.8e+21)
		tmp = Float64(b * a);
	elseif (b <= -3e-204)
		tmp = y;
	elseif (b <= 4.9e-26)
		tmp = x;
	else
		tmp = Float64(b * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -7.8e+21)
		tmp = b * a;
	elseif (b <= -3e-204)
		tmp = y;
	elseif (b <= 4.9e-26)
		tmp = x;
	else
		tmp = b * a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -7.8e+21], N[(b * a), $MachinePrecision], If[LessEqual[b, -3e-204], y, If[LessEqual[b, 4.9e-26], x, N[(b * a), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.8 \cdot 10^{+21}:\\
\;\;\;\;b \cdot a\\

\mathbf{elif}\;b \leq -3 \cdot 10^{-204}:\\
\;\;\;\;y\\

\mathbf{elif}\;b \leq 4.9 \cdot 10^{-26}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;b \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -7.8e21 or 4.8999999999999999e-26 < b

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -7.8e21 < b < -2.9999999999999998e-204

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -2.9999999999999998e-204 < b < 4.8999999999999999e-26

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 58.3% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a - 0.5\right) \cdot b\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{-103}:\\ \;\;\;\;x + t\_1\\ \mathbf{else}:\\ \;\;\;\;y + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- a 0.5) b))) (if (<= (+ x y) -1e-103) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (a - 0.5) * b;
	double tmp;
	if ((x + y) <= -1e-103) {
		tmp = x + t_1;
	} else {
		tmp = y + t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = (a - 0.5d0) * b
    if ((x + y) <= (-1d-103)) then
        tmp = x + t_1
    else
        tmp = y + 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 t_1 = (a - 0.5) * b;
	double tmp;
	if ((x + y) <= -1e-103) {
		tmp = x + t_1;
	} else {
		tmp = y + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (a - 0.5) * b
	tmp = 0
	if (x + y) <= -1e-103:
		tmp = x + t_1
	else:
		tmp = y + t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(a - 0.5) * b)
	tmp = 0.0
	if (Float64(x + y) <= -1e-103)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(y + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (a - 0.5) * b;
	tmp = 0.0;
	if ((x + y) <= -1e-103)
		tmp = x + t_1;
	else
		tmp = y + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -1e-103], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{-103}:\\
\;\;\;\;x + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < -9.99999999999999958e-104

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -9.99999999999999958e-104 < (+.f64 x y)

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 55.3% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + y \leq 10^{+28}:\\ \;\;\;\;x + \left(a - 0.5\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;y + b \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ x y) 1e+28) (+ x (* (- a 0.5) b)) (+ y (* b a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x + y) <= 1e+28) {
		tmp = x + ((a - 0.5) * b);
	} else {
		tmp = y + (b * a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if ((x + y) <= 1d+28) then
        tmp = x + ((a - 0.5d0) * b)
    else
        tmp = y + (b * a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x + y) <= 1e+28) {
		tmp = x + ((a - 0.5) * b);
	} else {
		tmp = y + (b * a);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (x + y) <= 1e+28:
		tmp = x + ((a - 0.5) * b)
	else:
		tmp = y + (b * a)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(x + y) <= 1e+28)
		tmp = Float64(x + Float64(Float64(a - 0.5) * b));
	else
		tmp = Float64(y + Float64(b * a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((x + y) <= 1e+28)
		tmp = x + ((a - 0.5) * b);
	else
		tmp = y + (b * a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 1e+28], N[(x + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 10^{+28}:\\
\;\;\;\;x + \left(a - 0.5\right) \cdot b\\

\mathbf{else}:\\
\;\;\;\;y + b \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < 9.99999999999999958e27

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 9.99999999999999958e27 < (+.f64 x y)

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 52.2% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.06 \cdot 10^{+92}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+111}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -1.06e+92) (* b a) (if (<= a 1.35e+111) (+ x y) (* b a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.06e+92) {
		tmp = b * a;
	} else if (a <= 1.35e+111) {
		tmp = x + y;
	} else {
		tmp = b * a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (a <= (-1.06d+92)) then
        tmp = b * a
    else if (a <= 1.35d+111) then
        tmp = x + y
    else
        tmp = b * a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.06e+92) {
		tmp = b * a;
	} else if (a <= 1.35e+111) {
		tmp = x + y;
	} else {
		tmp = b * a;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -1.06e+92:
		tmp = b * a
	elif a <= 1.35e+111:
		tmp = x + y
	else:
		tmp = b * a
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -1.06e+92)
		tmp = Float64(b * a);
	elseif (a <= 1.35e+111)
		tmp = Float64(x + y);
	else
		tmp = Float64(b * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -1.06e+92)
		tmp = b * a;
	elseif (a <= 1.35e+111)
		tmp = x + y;
	else
		tmp = b * a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.06e+92], N[(b * a), $MachinePrecision], If[LessEqual[a, 1.35e+111], N[(x + y), $MachinePrecision], N[(b * a), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.06 \cdot 10^{+92}:\\
\;\;\;\;b \cdot a\\

\mathbf{elif}\;a \leq 1.35 \cdot 10^{+111}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;b \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.05999999999999999e92 or 1.3499999999999999e111 < a

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.05999999999999999e92 < a < 1.3499999999999999e111

    1. Initial program 99.8%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in b around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 78.4% accurate, 12.8× speedup?

\[\begin{array}{l} \\ \left(y + x\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b) :precision binary64 (+ (+ y x) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return (y + x) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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
    code = (y + x) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (y + x) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return (y + x) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(y + x) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (y + x) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(y + x), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(y + x\right) + \left(a - 0.5\right) \cdot b
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0 0

    \[\leadsto expr\]
  4. Simplified0

    \[\leadsto expr\]
  5. Add Preprocessing

Alternative 19: 27.5% accurate, 19.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+33}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.5e+33) x y))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.5e+33) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (x <= (-1.5d+33)) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -1.5e+33) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -1.5e+33:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -1.5e+33)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -1.5e+33)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.5e+33], x, y]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+33}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.49999999999999992e33

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.49999999999999992e33 < x

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 22.5% accurate, 115.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    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
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 0

    \[\leadsto expr\]
  4. Simplified0

    \[\leadsto expr\]
  5. Add Preprocessing

Developer target: 99.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+
  (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t))))
  (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
    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
    code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b):
	return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}

Reproduce

?
herbie shell --seed 2024110 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))