
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- y z) (+ -1.0 (- z t))) a x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (-1.0 + (z - t))), a, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))), a, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{-1 + \left(z - t\right)}, a, x\right)
\end{array}
Initial program 98.1%
sub-neg98.1%
+-commutative98.1%
associate-/r/99.2%
distribute-lft-neg-in99.2%
fma-define99.2%
distribute-neg-frac299.2%
distribute-neg-in99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (/ z (- 1.0 z)))))
(t_2 (+ x (* (/ a t) (- z y))))
(t_3 (- x (* y a))))
(if (<= t -6.5e+34)
t_2
(if (<= t -3.7e-154)
t_1
(if (<= t -2.1e-275)
t_3
(if (<= t 2.8e-232) t_1 (if (<= t 5000000000.0) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a * (z / (1.0 - z)));
double t_2 = x + ((a / t) * (z - y));
double t_3 = x - (y * a);
double tmp;
if (t <= -6.5e+34) {
tmp = t_2;
} else if (t <= -3.7e-154) {
tmp = t_1;
} else if (t <= -2.1e-275) {
tmp = t_3;
} else if (t <= 2.8e-232) {
tmp = t_1;
} else if (t <= 5000000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x + (a * (z / (1.0d0 - z)))
t_2 = x + ((a / t) * (z - y))
t_3 = x - (y * a)
if (t <= (-6.5d+34)) then
tmp = t_2
else if (t <= (-3.7d-154)) then
tmp = t_1
else if (t <= (-2.1d-275)) then
tmp = t_3
else if (t <= 2.8d-232) then
tmp = t_1
else if (t <= 5000000000.0d0) then
tmp = t_3
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 t_1 = x + (a * (z / (1.0 - z)));
double t_2 = x + ((a / t) * (z - y));
double t_3 = x - (y * a);
double tmp;
if (t <= -6.5e+34) {
tmp = t_2;
} else if (t <= -3.7e-154) {
tmp = t_1;
} else if (t <= -2.1e-275) {
tmp = t_3;
} else if (t <= 2.8e-232) {
tmp = t_1;
} else if (t <= 5000000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a * (z / (1.0 - z))) t_2 = x + ((a / t) * (z - y)) t_3 = x - (y * a) tmp = 0 if t <= -6.5e+34: tmp = t_2 elif t <= -3.7e-154: tmp = t_1 elif t <= -2.1e-275: tmp = t_3 elif t <= 2.8e-232: tmp = t_1 elif t <= 5000000000.0: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a * Float64(z / Float64(1.0 - z)))) t_2 = Float64(x + Float64(Float64(a / t) * Float64(z - y))) t_3 = Float64(x - Float64(y * a)) tmp = 0.0 if (t <= -6.5e+34) tmp = t_2; elseif (t <= -3.7e-154) tmp = t_1; elseif (t <= -2.1e-275) tmp = t_3; elseif (t <= 2.8e-232) tmp = t_1; elseif (t <= 5000000000.0) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a * (z / (1.0 - z))); t_2 = x + ((a / t) * (z - y)); t_3 = x - (y * a); tmp = 0.0; if (t <= -6.5e+34) tmp = t_2; elseif (t <= -3.7e-154) tmp = t_1; elseif (t <= -2.1e-275) tmp = t_3; elseif (t <= 2.8e-232) tmp = t_1; elseif (t <= 5000000000.0) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+34], t$95$2, If[LessEqual[t, -3.7e-154], t$95$1, If[LessEqual[t, -2.1e-275], t$95$3, If[LessEqual[t, 2.8e-232], t$95$1, If[LessEqual[t, 5000000000.0], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \frac{z}{1 - z}\\
t_2 := x + \frac{a}{t} \cdot \left(z - y\right)\\
t_3 := x - y \cdot a\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.7 \cdot 10^{-154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-275}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-232}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5000000000:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.50000000000000017e34 or 5e9 < t Initial program 96.3%
clear-num96.2%
associate-/r/96.3%
clear-num98.0%
Applied egg-rr98.0%
Taylor expanded in t around inf 87.2%
if -6.50000000000000017e34 < t < -3.69999999999999987e-154 or -2.09999999999999988e-275 < t < 2.79999999999999993e-232Initial program 99.8%
clear-num99.7%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 96.5%
Taylor expanded in y around 0 68.3%
mul-1-neg68.3%
associate-/l*77.5%
Simplified77.5%
if -3.69999999999999987e-154 < t < -2.09999999999999988e-275 or 2.79999999999999993e-232 < t < 5e9Initial program 99.2%
clear-num99.1%
associate-/r/99.2%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in t around 0 99.3%
Taylor expanded in z around 0 80.4%
Final simplification82.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ a (- 1.0 z)))))
(t_2 (+ x (* (/ a t) (- z y))))
(t_3 (- x (* y a))))
(if (<= t -6.5e+34)
t_2
(if (<= t -9e-152)
t_1
(if (<= t -3.8e-275)
t_3
(if (<= t 3.05e-232) t_1 (if (<= t 4500000000.0) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (a / (1.0 - z)));
double t_2 = x + ((a / t) * (z - y));
double t_3 = x - (y * a);
double tmp;
if (t <= -6.5e+34) {
tmp = t_2;
} else if (t <= -9e-152) {
tmp = t_1;
} else if (t <= -3.8e-275) {
tmp = t_3;
} else if (t <= 3.05e-232) {
tmp = t_1;
} else if (t <= 4500000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x + (z * (a / (1.0d0 - z)))
t_2 = x + ((a / t) * (z - y))
t_3 = x - (y * a)
if (t <= (-6.5d+34)) then
tmp = t_2
else if (t <= (-9d-152)) then
tmp = t_1
else if (t <= (-3.8d-275)) then
tmp = t_3
else if (t <= 3.05d-232) then
tmp = t_1
else if (t <= 4500000000.0d0) then
tmp = t_3
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 t_1 = x + (z * (a / (1.0 - z)));
double t_2 = x + ((a / t) * (z - y));
double t_3 = x - (y * a);
double tmp;
if (t <= -6.5e+34) {
tmp = t_2;
} else if (t <= -9e-152) {
tmp = t_1;
} else if (t <= -3.8e-275) {
tmp = t_3;
} else if (t <= 3.05e-232) {
tmp = t_1;
} else if (t <= 4500000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (a / (1.0 - z))) t_2 = x + ((a / t) * (z - y)) t_3 = x - (y * a) tmp = 0 if t <= -6.5e+34: tmp = t_2 elif t <= -9e-152: tmp = t_1 elif t <= -3.8e-275: tmp = t_3 elif t <= 3.05e-232: tmp = t_1 elif t <= 4500000000.0: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(a / Float64(1.0 - z)))) t_2 = Float64(x + Float64(Float64(a / t) * Float64(z - y))) t_3 = Float64(x - Float64(y * a)) tmp = 0.0 if (t <= -6.5e+34) tmp = t_2; elseif (t <= -9e-152) tmp = t_1; elseif (t <= -3.8e-275) tmp = t_3; elseif (t <= 3.05e-232) tmp = t_1; elseif (t <= 4500000000.0) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (a / (1.0 - z))); t_2 = x + ((a / t) * (z - y)); t_3 = x - (y * a); tmp = 0.0; if (t <= -6.5e+34) tmp = t_2; elseif (t <= -9e-152) tmp = t_1; elseif (t <= -3.8e-275) tmp = t_3; elseif (t <= 3.05e-232) tmp = t_1; elseif (t <= 4500000000.0) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(a / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+34], t$95$2, If[LessEqual[t, -9e-152], t$95$1, If[LessEqual[t, -3.8e-275], t$95$3, If[LessEqual[t, 3.05e-232], t$95$1, If[LessEqual[t, 4500000000.0], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{a}{1 - z}\\
t_2 := x + \frac{a}{t} \cdot \left(z - y\right)\\
t_3 := x - y \cdot a\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-275}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 3.05 \cdot 10^{-232}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4500000000:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.50000000000000017e34 or 4.5e9 < t Initial program 96.3%
clear-num96.2%
associate-/r/96.3%
clear-num98.0%
Applied egg-rr98.0%
Taylor expanded in t around inf 87.2%
if -6.50000000000000017e34 < t < -9.0000000000000008e-152 or -3.79999999999999972e-275 < t < 3.0500000000000001e-232Initial program 99.8%
clear-num99.7%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 96.5%
Taylor expanded in y around 0 68.3%
mul-1-neg68.3%
*-commutative68.3%
associate-*r/77.4%
distribute-rgt-neg-in77.4%
distribute-frac-neg277.4%
neg-sub077.4%
associate--r-77.4%
metadata-eval77.4%
Simplified77.4%
if -9.0000000000000008e-152 < t < -3.79999999999999972e-275 or 3.0500000000000001e-232 < t < 4.5e9Initial program 99.2%
clear-num99.1%
associate-/r/99.2%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in t around 0 99.3%
Taylor expanded in z around 0 80.4%
Final simplification82.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ a z)))))
(if (<= z -19.0)
t_1
(if (<= z 6e-164)
(- x (* y a))
(if (<= z 1420000000000.0) (+ x (* (/ a t) (- z y))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (a / z));
double tmp;
if (z <= -19.0) {
tmp = t_1;
} else if (z <= 6e-164) {
tmp = x - (y * a);
} else if (z <= 1420000000000.0) {
tmp = x + ((a / t) * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * (a / z))
if (z <= (-19.0d0)) then
tmp = t_1
else if (z <= 6d-164) then
tmp = x - (y * a)
else if (z <= 1420000000000.0d0) then
tmp = x + ((a / t) * (z - 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 t_1 = x + ((y - z) * (a / z));
double tmp;
if (z <= -19.0) {
tmp = t_1;
} else if (z <= 6e-164) {
tmp = x - (y * a);
} else if (z <= 1420000000000.0) {
tmp = x + ((a / t) * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (a / z)) tmp = 0 if z <= -19.0: tmp = t_1 elif z <= 6e-164: tmp = x - (y * a) elif z <= 1420000000000.0: tmp = x + ((a / t) * (z - y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(a / z))) tmp = 0.0 if (z <= -19.0) tmp = t_1; elseif (z <= 6e-164) tmp = Float64(x - Float64(y * a)); elseif (z <= 1420000000000.0) tmp = Float64(x + Float64(Float64(a / t) * Float64(z - y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * (a / z)); tmp = 0.0; if (z <= -19.0) tmp = t_1; elseif (z <= 6e-164) tmp = x - (y * a); elseif (z <= 1420000000000.0) tmp = x + ((a / t) * (z - y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -19.0], t$95$1, If[LessEqual[z, 6e-164], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1420000000000.0], N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{a}{z}\\
\mathbf{if}\;z \leq -19:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-164}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;z \leq 1420000000000:\\
\;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -19 or 1.42e12 < z Initial program 97.1%
clear-num96.9%
associate-/r/97.0%
clear-num97.8%
Applied egg-rr97.8%
Taylor expanded in t around 0 88.6%
Taylor expanded in z around inf 88.2%
associate-*r/88.2%
neg-mul-188.2%
Simplified88.2%
if -19 < z < 6.0000000000000002e-164Initial program 98.8%
clear-num98.7%
associate-/r/98.9%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 75.7%
Taylor expanded in z around 0 71.9%
if 6.0000000000000002e-164 < z < 1.42e12Initial program 99.8%
clear-num99.8%
associate-/r/99.9%
clear-num100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 78.5%
Final simplification80.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8e-8)
(- x a)
(if (<= z 8e-96)
(- x (* y a))
(if (<= z 3.5e+38) (+ x (* a (/ z t))) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e-8) {
tmp = x - a;
} else if (z <= 8e-96) {
tmp = x - (y * a);
} else if (z <= 3.5e+38) {
tmp = x + (a * (z / t));
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8d-8)) then
tmp = x - a
else if (z <= 8d-96) then
tmp = x - (y * a)
else if (z <= 3.5d+38) then
tmp = x + (a * (z / t))
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e-8) {
tmp = x - a;
} else if (z <= 8e-96) {
tmp = x - (y * a);
} else if (z <= 3.5e+38) {
tmp = x + (a * (z / t));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e-8: tmp = x - a elif z <= 8e-96: tmp = x - (y * a) elif z <= 3.5e+38: tmp = x + (a * (z / t)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e-8) tmp = Float64(x - a); elseif (z <= 8e-96) tmp = Float64(x - Float64(y * a)); elseif (z <= 3.5e+38) tmp = Float64(x + Float64(a * Float64(z / t))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e-8) tmp = x - a; elseif (z <= 8e-96) tmp = x - (y * a); elseif (z <= 3.5e+38) tmp = x + (a * (z / t)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e-8], N[(x - a), $MachinePrecision], If[LessEqual[z, 8e-96], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+38], N[(x + N[(a * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-8}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-96}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+38}:\\
\;\;\;\;x + a \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8.0000000000000002e-8 or 3.50000000000000002e38 < z Initial program 96.9%
Taylor expanded in z around inf 79.1%
if -8.0000000000000002e-8 < z < 7.9999999999999993e-96Initial program 98.9%
clear-num98.8%
associate-/r/99.0%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 75.9%
Taylor expanded in z around 0 70.9%
if 7.9999999999999993e-96 < z < 3.50000000000000002e38Initial program 99.9%
clear-num99.9%
associate-/r/99.9%
clear-num100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 79.1%
Taylor expanded in y around 0 70.5%
mul-1-neg70.5%
associate-/l*70.5%
distribute-rgt-neg-in70.5%
Simplified70.5%
Final simplification74.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.8e+34) (not (<= t 8000000000.0))) (+ x (* (/ a t) (- z y))) (+ x (* (- y z) (/ a (+ z -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.8e+34) || !(t <= 8000000000.0)) {
tmp = x + ((a / t) * (z - y));
} else {
tmp = x + ((y - z) * (a / (z + -1.0)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6.8d+34)) .or. (.not. (t <= 8000000000.0d0))) then
tmp = x + ((a / t) * (z - y))
else
tmp = x + ((y - z) * (a / (z + (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.8e+34) || !(t <= 8000000000.0)) {
tmp = x + ((a / t) * (z - y));
} else {
tmp = x + ((y - z) * (a / (z + -1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.8e+34) or not (t <= 8000000000.0): tmp = x + ((a / t) * (z - y)) else: tmp = x + ((y - z) * (a / (z + -1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.8e+34) || !(t <= 8000000000.0)) tmp = Float64(x + Float64(Float64(a / t) * Float64(z - y))); else tmp = Float64(x + Float64(Float64(y - z) * Float64(a / Float64(z + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.8e+34) || ~((t <= 8000000000.0))) tmp = x + ((a / t) * (z - y)); else tmp = x + ((y - z) * (a / (z + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.8e+34], N[Not[LessEqual[t, 8000000000.0]], $MachinePrecision]], N[(x + N[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+34} \lor \neg \left(t \leq 8000000000\right):\\
\;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{a}{z + -1}\\
\end{array}
\end{array}
if t < -6.7999999999999999e34 or 8e9 < t Initial program 96.3%
clear-num96.2%
associate-/r/96.3%
clear-num98.0%
Applied egg-rr98.0%
Taylor expanded in t around inf 87.2%
if -6.7999999999999999e34 < t < 8e9Initial program 99.5%
clear-num99.4%
associate-/r/99.5%
clear-num99.6%
Applied egg-rr99.6%
Taylor expanded in t around 0 97.9%
Final simplification93.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.2e-6) (- x a) (if (<= z 1.3e-62) (- x (* y a)) (+ x (* z (/ a (- 1.0 z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-6) {
tmp = x - a;
} else if (z <= 1.3e-62) {
tmp = x - (y * a);
} else {
tmp = x + (z * (a / (1.0 - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-6.2d-6)) then
tmp = x - a
else if (z <= 1.3d-62) then
tmp = x - (y * a)
else
tmp = x + (z * (a / (1.0d0 - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-6) {
tmp = x - a;
} else if (z <= 1.3e-62) {
tmp = x - (y * a);
} else {
tmp = x + (z * (a / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.2e-6: tmp = x - a elif z <= 1.3e-62: tmp = x - (y * a) else: tmp = x + (z * (a / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e-6) tmp = Float64(x - a); elseif (z <= 1.3e-62) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x + Float64(z * Float64(a / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.2e-6) tmp = x - a; elseif (z <= 1.3e-62) tmp = x - (y * a); else tmp = x + (z * (a / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.2e-6], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.3e-62], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(a / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-6}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-62}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{a}{1 - z}\\
\end{array}
\end{array}
if z < -6.1999999999999999e-6Initial program 95.4%
Taylor expanded in z around inf 80.3%
if -6.1999999999999999e-6 < z < 1.3e-62Initial program 98.9%
clear-num98.9%
associate-/r/99.0%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 73.4%
Taylor expanded in z around 0 69.5%
if 1.3e-62 < z Initial program 99.9%
clear-num99.8%
associate-/r/99.9%
clear-num100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 81.1%
Taylor expanded in y around 0 61.2%
mul-1-neg61.2%
*-commutative61.2%
associate-*r/71.1%
distribute-rgt-neg-in71.1%
distribute-frac-neg271.1%
neg-sub071.1%
associate--r-71.1%
metadata-eval71.1%
Simplified71.1%
Final simplification73.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.8e-6) (not (<= z 11.5))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e-6) || !(z <= 11.5)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.8d-6)) .or. (.not. (z <= 11.5d0))) then
tmp = x - a
else
tmp = x - (y * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e-6) || !(z <= 11.5)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.8e-6) or not (z <= 11.5): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.8e-6) || !(z <= 11.5)) tmp = Float64(x - a); else tmp = Float64(x - Float64(y * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.8e-6) || ~((z <= 11.5))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.8e-6], N[Not[LessEqual[z, 11.5]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-6} \lor \neg \left(z \leq 11.5\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -5.8000000000000004e-6 or 11.5 < z Initial program 97.2%
Taylor expanded in z around inf 76.4%
if -5.8000000000000004e-6 < z < 11.5Initial program 99.0%
clear-num99.0%
associate-/r/99.1%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 73.3%
Taylor expanded in z around 0 68.3%
Final simplification72.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-32) (not (<= z 370000000000.0))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-32) || !(z <= 370000000000.0)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.35d-32)) .or. (.not. (z <= 370000000000.0d0))) then
tmp = x - a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-32) || !(z <= 370000000000.0)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-32) or not (z <= 370000000000.0): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-32) || !(z <= 370000000000.0)) tmp = Float64(x - a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.35e-32) || ~((z <= 370000000000.0))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e-32], N[Not[LessEqual[z, 370000000000.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-32} \lor \neg \left(z \leq 370000000000\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.3499999999999999e-32 or 3.7e11 < z Initial program 97.3%
Taylor expanded in z around inf 75.6%
if -1.3499999999999999e-32 < z < 3.7e11Initial program 99.0%
sub-neg99.0%
+-commutative99.0%
associate-/r/98.4%
distribute-lft-neg-in98.4%
fma-define98.5%
distribute-neg-frac298.5%
distribute-neg-in98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in t around inf 50.9%
Final simplification63.3%
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- y z) (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (a * ((y - z) / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + (a * ((y - z) / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((y - z) / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{y - z}{-1 + \left(z - t\right)}
\end{array}
Initial program 98.1%
associate-/r/99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ a (+ (- t z) 1.0)) (- z y))))
double code(double x, double y, double z, double t, double a) {
return x + ((a / ((t - z) + 1.0)) * (z - y));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((a / ((t - z) + 1.0d0)) * (z - y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((a / ((t - z) + 1.0)) * (z - y));
}
def code(x, y, z, t, a): return x + ((a / ((t - z) + 1.0)) * (z - y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(a / Float64(Float64(t - z) + 1.0)) * Float64(z - y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((a / ((t - z) + 1.0)) * (z - y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(a / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\left(t - z\right) + 1} \cdot \left(z - y\right)
\end{array}
Initial program 98.1%
clear-num98.1%
associate-/r/98.2%
clear-num98.9%
Applied egg-rr98.9%
Final simplification98.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.8e-238) x (if (<= x 2.9e-85) (- a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.8e-238) {
tmp = x;
} else if (x <= 2.9e-85) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-3.8d-238)) then
tmp = x
else if (x <= 2.9d-85) then
tmp = -a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.8e-238) {
tmp = x;
} else if (x <= 2.9e-85) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.8e-238: tmp = x elif x <= 2.9e-85: tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.8e-238) tmp = x; elseif (x <= 2.9e-85) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -3.8e-238) tmp = x; elseif (x <= 2.9e-85) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.8e-238], x, If[LessEqual[x, 2.9e-85], (-a), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-238}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-85}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.7999999999999997e-238 or 2.9000000000000002e-85 < x Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-/r/100.0%
distribute-lft-neg-in100.0%
fma-define100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf 65.4%
if -3.7999999999999997e-238 < x < 2.9000000000000002e-85Initial program 94.3%
associate-/r/96.8%
Simplified96.8%
associate-/r/94.3%
div-inv94.2%
associate-/r*96.6%
Applied egg-rr96.6%
Taylor expanded in z around inf 30.9%
Taylor expanded in x around 0 26.5%
neg-mul-126.5%
Simplified26.5%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.1%
sub-neg98.1%
+-commutative98.1%
associate-/r/99.2%
distribute-lft-neg-in99.2%
fma-define99.2%
distribute-neg-frac299.2%
distribute-neg-in99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in t around inf 52.5%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (((y - z) / ((t - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024111
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))