
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
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 * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
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 * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- b y) y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -6e+43)
t_2
(if (<= z 4.8e+45) (fma x (/ y t_1) (/ (* z (- t a)) t_1)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (b - y), y);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -6e+43) {
tmp = t_2;
} else if (z <= 4.8e+45) {
tmp = fma(x, (y / t_1), ((z * (t - a)) / t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(b - y), y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -6e+43) tmp = t_2; elseif (z <= 4.8e+45) tmp = fma(x, Float64(y / t_1), Float64(Float64(z * Float64(t - a)) / t_1)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+43], t$95$2, If[LessEqual[z, 4.8e+45], N[(x * N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, b - y, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+43}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{t\_1}, \frac{z \cdot \left(t - a\right)}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.00000000000000033e43 or 4.79999999999999979e45 < z Initial program 45.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6487.4
Simplified87.4%
if -6.00000000000000033e43 < z < 4.79999999999999979e45Initial program 89.3%
Taylor expanded in x around 0
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6497.8
Simplified97.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.6e+42)
t_1
(if (<= z 4.6e+45)
(/ (+ (* z (- t a)) (* y x)) (+ y (* z (- b y))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.6e+42) {
tmp = t_1;
} else if (z <= 4.6e+45) {
tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - 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 = (t - a) / (b - y)
if (z <= (-1.6d+42)) then
tmp = t_1
else if (z <= 4.6d+45) then
tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - 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 = (t - a) / (b - y);
double tmp;
if (z <= -1.6e+42) {
tmp = t_1;
} else if (z <= 4.6e+45) {
tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -1.6e+42: tmp = t_1 elif z <= 4.6e+45: tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.6e+42) tmp = t_1; elseif (z <= 4.6e+45) tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -1.6e+42) tmp = t_1; elseif (z <= 4.6e+45) tmp = ((z * (t - a)) + (y * x)) / (y + (z * (b - y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+42], t$95$1, If[LessEqual[z, 4.6e+45], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+45}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + y \cdot x}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.60000000000000001e42 or 4.60000000000000025e45 < z Initial program 44.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6486.6
Simplified86.6%
if -1.60000000000000001e42 < z < 4.60000000000000025e45Initial program 89.9%
Final simplification88.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- b y) y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -330.0)
t_2
(if (<= z -1.48e-164)
(/ (* z (- t a)) t_1)
(if (<= z 5.8e-40) (/ (* y x) t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (b - y), y);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -330.0) {
tmp = t_2;
} else if (z <= -1.48e-164) {
tmp = (z * (t - a)) / t_1;
} else if (z <= 5.8e-40) {
tmp = (y * x) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(b - y), y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -330.0) tmp = t_2; elseif (z <= -1.48e-164) tmp = Float64(Float64(z * Float64(t - a)) / t_1); elseif (z <= 5.8e-40) tmp = Float64(Float64(y * x) / t_1); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -330.0], t$95$2, If[LessEqual[z, -1.48e-164], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 5.8e-40], N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, b - y, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -330:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.48 \cdot 10^{-164}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{t\_1}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-40}:\\
\;\;\;\;\frac{y \cdot x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -330 or 5.7999999999999998e-40 < z Initial program 53.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.0
Simplified83.0%
if -330 < z < -1.48000000000000001e-164Initial program 94.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6465.0
Simplified65.0%
if -1.48000000000000001e-164 < z < 5.7999999999999998e-40Initial program 86.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6454.5
Simplified54.5%
Final simplification71.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- b y) y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -1.3e+47)
t_2
(if (<= z -1.48e-164)
(* (- t a) (/ z t_1))
(if (<= z 5.8e-40) (/ (* y x) t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (b - y), y);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1.3e+47) {
tmp = t_2;
} else if (z <= -1.48e-164) {
tmp = (t - a) * (z / t_1);
} else if (z <= 5.8e-40) {
tmp = (y * x) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(b - y), y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.3e+47) tmp = t_2; elseif (z <= -1.48e-164) tmp = Float64(Float64(t - a) * Float64(z / t_1)); elseif (z <= 5.8e-40) tmp = Float64(Float64(y * x) / t_1); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+47], t$95$2, If[LessEqual[z, -1.48e-164], N[(N[(t - a), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-40], N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, b - y, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.48 \cdot 10^{-164}:\\
\;\;\;\;\left(t - a\right) \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-40}:\\
\;\;\;\;\frac{y \cdot x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.30000000000000002e47 or 5.7999999999999998e-40 < z Initial program 51.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.8
Simplified84.8%
if -1.30000000000000002e47 < z < -1.48000000000000001e-164Initial program 91.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6461.9
Simplified61.9%
lift--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.8
Applied egg-rr61.8%
if -1.48000000000000001e-164 < z < 5.7999999999999998e-40Initial program 86.1%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6454.5
Simplified54.5%
Final simplification70.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.65e-17)
t_1
(if (<= z 6.4e-33) (/ (fma x y (* z t)) (fma z (- b y) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.65e-17) {
tmp = t_1;
} else if (z <= 6.4e-33) {
tmp = fma(x, y, (z * t)) / fma(z, (b - y), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.65e-17) tmp = t_1; elseif (z <= 6.4e-33) tmp = Float64(fma(x, y, Float64(z * t)) / fma(z, Float64(b - y), y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.65e-17], t$95$1, If[LessEqual[z, 6.4e-33], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot t\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.6499999999999999e-17 or 6.39999999999999954e-33 < z Initial program 54.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.4
Simplified83.4%
if -2.6499999999999999e-17 < z < 6.39999999999999954e-33Initial program 88.7%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
Applied egg-rr88.5%
Taylor expanded in a around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6470.0
Simplified70.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -3.15e-19)
t_1
(if (<= z 5.3e-45) (* (fma z (- t a) (* y x)) (/ 1.0 y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -3.15e-19) {
tmp = t_1;
} else if (z <= 5.3e-45) {
tmp = fma(z, (t - a), (y * x)) * (1.0 / y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3.15e-19) tmp = t_1; elseif (z <= 5.3e-45) tmp = Float64(fma(z, Float64(t - a), Float64(y * x)) * Float64(1.0 / y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.15e-19], t$95$1, If[LessEqual[z, 5.3e-45], N[(N[(z * N[(t - a), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.15 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-45}:\\
\;\;\;\;\mathsf{fma}\left(z, t - a, y \cdot x\right) \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.15000000000000009e-19 or 5.2999999999999997e-45 < z Initial program 55.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.0
Simplified82.0%
if -3.15000000000000009e-19 < z < 5.2999999999999997e-45Initial program 88.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-invN/A
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
Applied egg-rr88.0%
Taylor expanded in z around 0
lower-/.f6463.1
Simplified63.1%
Final simplification73.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.8e-100)
t_1
(if (<= z 5.8e-40) (/ (* y x) (fma z (- b y) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.8e-100) {
tmp = t_1;
} else if (z <= 5.8e-40) {
tmp = (y * x) / fma(z, (b - y), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.8e-100) tmp = t_1; elseif (z <= 5.8e-40) tmp = Float64(Float64(y * x) / fma(z, Float64(b - y), y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e-100], t$95$1, If[LessEqual[z, 5.8e-40], N[(N[(y * x), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{-100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-40}:\\
\;\;\;\;\frac{y \cdot x}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.79999999999999995e-100 or 5.7999999999999998e-40 < z Initial program 59.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6476.3
Simplified76.3%
if -2.79999999999999995e-100 < z < 5.7999999999999998e-40Initial program 88.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6453.6
Simplified53.6%
Final simplification67.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -2.1e+85)
t_1
(if (<= y 2.1e-10) (/ (- t a) b) (if (<= y 4.2e+81) (/ a (- y b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -2.1e+85) {
tmp = t_1;
} else if (y <= 2.1e-10) {
tmp = (t - a) / b;
} else if (y <= 4.2e+81) {
tmp = a / (y - 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 = x / (1.0d0 - z)
if (y <= (-2.1d+85)) then
tmp = t_1
else if (y <= 2.1d-10) then
tmp = (t - a) / b
else if (y <= 4.2d+81) then
tmp = a / (y - 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 = x / (1.0 - z);
double tmp;
if (y <= -2.1e+85) {
tmp = t_1;
} else if (y <= 2.1e-10) {
tmp = (t - a) / b;
} else if (y <= 4.2e+81) {
tmp = a / (y - b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -2.1e+85: tmp = t_1 elif y <= 2.1e-10: tmp = (t - a) / b elif y <= 4.2e+81: tmp = a / (y - b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -2.1e+85) tmp = t_1; elseif (y <= 2.1e-10) tmp = Float64(Float64(t - a) / b); elseif (y <= 4.2e+81) tmp = Float64(a / Float64(y - b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -2.1e+85) tmp = t_1; elseif (y <= 2.1e-10) tmp = (t - a) / b; elseif (y <= 4.2e+81) tmp = a / (y - b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+85], t$95$1, If[LessEqual[y, 2.1e-10], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 4.2e+81], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-10}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+81}:\\
\;\;\;\;\frac{a}{y - b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.1000000000000001e85 or 4.1999999999999997e81 < y Initial program 56.4%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6454.9
Simplified54.9%
if -2.1000000000000001e85 < y < 2.1e-10Initial program 80.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6458.0
Simplified58.0%
if 2.1e-10 < y < 4.1999999999999997e81Initial program 54.5%
Taylor expanded in a around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6416.0
Simplified16.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6448.1
Simplified48.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -6.5e-136) t_1 (if (<= z 7.5e-51) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -6.5e-136) {
tmp = t_1;
} else if (z <= 7.5e-51) {
tmp = x;
} 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 = (t - a) / (b - y)
if (z <= (-6.5d-136)) then
tmp = t_1
else if (z <= 7.5d-51) then
tmp = 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 t_1 = (t - a) / (b - y);
double tmp;
if (z <= -6.5e-136) {
tmp = t_1;
} else if (z <= 7.5e-51) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -6.5e-136: tmp = t_1 elif z <= 7.5e-51: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -6.5e-136) tmp = t_1; elseif (z <= 7.5e-51) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -6.5e-136) tmp = t_1; elseif (z <= 7.5e-51) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e-136], t$95$1, If[LessEqual[z, 7.5e-51], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{-136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.50000000000000011e-136 or 7.49999999999999976e-51 < z Initial program 61.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6474.3
Simplified74.3%
if -6.50000000000000011e-136 < z < 7.49999999999999976e-51Initial program 86.9%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6451.4
Simplified51.4%
Taylor expanded in z around 0
Simplified51.4%
Final simplification66.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ a (- y b)))) (if (<= z -3.3e-19) t_1 (if (<= z 5e-49) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / (y - b);
double tmp;
if (z <= -3.3e-19) {
tmp = t_1;
} else if (z <= 5e-49) {
tmp = x;
} 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 = a / (y - b)
if (z <= (-3.3d-19)) then
tmp = t_1
else if (z <= 5d-49) then
tmp = 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 t_1 = a / (y - b);
double tmp;
if (z <= -3.3e-19) {
tmp = t_1;
} else if (z <= 5e-49) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / (y - b) tmp = 0 if z <= -3.3e-19: tmp = t_1 elif z <= 5e-49: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(y - b)) tmp = 0.0 if (z <= -3.3e-19) tmp = t_1; elseif (z <= 5e-49) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / (y - b); tmp = 0.0; if (z <= -3.3e-19) tmp = t_1; elseif (z <= 5e-49) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e-19], t$95$1, If[LessEqual[z, 5e-49], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{y - b}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.2999999999999998e-19 or 4.9999999999999999e-49 < z Initial program 55.7%
Taylor expanded in a around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6430.4
Simplified30.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6448.1
Simplified48.1%
if -3.2999999999999998e-19 < z < 4.9999999999999999e-49Initial program 88.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6446.0
Simplified46.0%
Taylor expanded in z around 0
Simplified46.0%
Final simplification47.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ a (- b)))) (if (<= z -3.3e-19) t_1 (if (<= z 5e-49) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / -b;
double tmp;
if (z <= -3.3e-19) {
tmp = t_1;
} else if (z <= 5e-49) {
tmp = x;
} 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 = a / -b
if (z <= (-3.3d-19)) then
tmp = t_1
else if (z <= 5d-49) then
tmp = 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 t_1 = a / -b;
double tmp;
if (z <= -3.3e-19) {
tmp = t_1;
} else if (z <= 5e-49) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / -b tmp = 0 if z <= -3.3e-19: tmp = t_1 elif z <= 5e-49: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(-b)) tmp = 0.0 if (z <= -3.3e-19) tmp = t_1; elseif (z <= 5e-49) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / -b; tmp = 0.0; if (z <= -3.3e-19) tmp = t_1; elseif (z <= 5e-49) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / (-b)), $MachinePrecision]}, If[LessEqual[z, -3.3e-19], t$95$1, If[LessEqual[z, 5e-49], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{-b}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.2999999999999998e-19 or 4.9999999999999999e-49 < z Initial program 55.7%
Taylor expanded in a around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6430.4
Simplified30.4%
Taylor expanded in b around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6431.3
Simplified31.3%
if -3.2999999999999998e-19 < z < 4.9999999999999999e-49Initial program 88.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6446.0
Simplified46.0%
Taylor expanded in z around 0
Simplified46.0%
Final simplification37.9%
(FPCore (x y z t a b) :precision binary64 (fma z x x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(z, x, x);
}
function code(x, y, z, t, a, b) return fma(z, x, x) end
code[x_, y_, z_, t_, a_, b_] := N[(z * x + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, x, x\right)
\end{array}
Initial program 70.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6428.7
Simplified28.7%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6423.2
Simplified23.2%
(FPCore (x y z t a b) :precision binary64 (* z x))
double code(double x, double y, double z, double t, double a, double b) {
return z * 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 = z * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z * x;
}
def code(x, y, z, t, a, b): return z * x
function code(x, y, z, t, a, b) return Float64(z * x) end
function tmp = code(x, y, z, t, a, b) tmp = z * x; end
code[x_, y_, z_, t_, a_, b_] := N[(z * x), $MachinePrecision]
\begin{array}{l}
\\
z \cdot x
\end{array}
Initial program 70.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6428.7
Simplified28.7%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6423.2
Simplified23.2%
Taylor expanded in z around inf
lower-*.f644.1
Simplified4.1%
Final simplification4.1%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
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 = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024207
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))