
(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 12 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 96.2%
sub-neg96.2%
+-commutative96.2%
associate-/r/99.7%
distribute-lft-neg-in99.7%
fma-define99.7%
distribute-neg-frac299.7%
distribute-neg-in99.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (/ y (+ z -1.0))))))
(if (<= z -6.2e+134)
(- x a)
(if (<= z 4.5e-197)
t_1
(if (<= z 3.3e-107)
(- x (/ (* y a) t))
(if (<= z 1.76e+134) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a * (y / (z + -1.0)));
double tmp;
if (z <= -6.2e+134) {
tmp = x - a;
} else if (z <= 4.5e-197) {
tmp = t_1;
} else if (z <= 3.3e-107) {
tmp = x - ((y * a) / t);
} else if (z <= 1.76e+134) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (a * (y / (z + (-1.0d0))))
if (z <= (-6.2d+134)) then
tmp = x - a
else if (z <= 4.5d-197) then
tmp = t_1
else if (z <= 3.3d-107) then
tmp = x - ((y * a) / t)
else if (z <= 1.76d+134) then
tmp = t_1
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 t_1 = x + (a * (y / (z + -1.0)));
double tmp;
if (z <= -6.2e+134) {
tmp = x - a;
} else if (z <= 4.5e-197) {
tmp = t_1;
} else if (z <= 3.3e-107) {
tmp = x - ((y * a) / t);
} else if (z <= 1.76e+134) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a * (y / (z + -1.0))) tmp = 0 if z <= -6.2e+134: tmp = x - a elif z <= 4.5e-197: tmp = t_1 elif z <= 3.3e-107: tmp = x - ((y * a) / t) elif z <= 1.76e+134: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a * Float64(y / Float64(z + -1.0)))) tmp = 0.0 if (z <= -6.2e+134) tmp = Float64(x - a); elseif (z <= 4.5e-197) tmp = t_1; elseif (z <= 3.3e-107) tmp = Float64(x - Float64(Float64(y * a) / t)); elseif (z <= 1.76e+134) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a * (y / (z + -1.0))); tmp = 0.0; if (z <= -6.2e+134) tmp = x - a; elseif (z <= 4.5e-197) tmp = t_1; elseif (z <= 3.3e-107) tmp = x - ((y * a) / t); elseif (z <= 1.76e+134) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(y / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+134], N[(x - a), $MachinePrecision], If[LessEqual[z, 4.5e-197], t$95$1, If[LessEqual[z, 3.3e-107], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.76e+134], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \frac{y}{z + -1}\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+134}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-107}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{elif}\;z \leq 1.76 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6.19999999999999963e134 or 1.76e134 < z Initial program 91.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 86.2%
if -6.19999999999999963e134 < z < 4.5000000000000001e-197 or 3.30000000000000004e-107 < z < 1.76e134Initial program 98.8%
associate-/r/99.6%
Simplified99.6%
associate-/r/98.8%
clear-num98.7%
Applied egg-rr98.7%
Taylor expanded in t around 0 79.9%
Taylor expanded in y around inf 78.7%
associate-/l*79.3%
Simplified79.3%
if 4.5000000000000001e-197 < z < 3.30000000000000004e-107Initial program 91.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 84.5%
Taylor expanded in y around inf 84.8%
Final simplification81.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y a))))
(if (<= z -4.3e+18)
(- x a)
(if (<= z 1.86e-196)
t_1
(if (<= z 1.75e-133)
(- x (* y (/ a t)))
(if (<= z 1.45e-7) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * a);
double tmp;
if (z <= -4.3e+18) {
tmp = x - a;
} else if (z <= 1.86e-196) {
tmp = t_1;
} else if (z <= 1.75e-133) {
tmp = x - (y * (a / t));
} else if (z <= 1.45e-7) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x - (y * a)
if (z <= (-4.3d+18)) then
tmp = x - a
else if (z <= 1.86d-196) then
tmp = t_1
else if (z <= 1.75d-133) then
tmp = x - (y * (a / t))
else if (z <= 1.45d-7) then
tmp = t_1
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 t_1 = x - (y * a);
double tmp;
if (z <= -4.3e+18) {
tmp = x - a;
} else if (z <= 1.86e-196) {
tmp = t_1;
} else if (z <= 1.75e-133) {
tmp = x - (y * (a / t));
} else if (z <= 1.45e-7) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * a) tmp = 0 if z <= -4.3e+18: tmp = x - a elif z <= 1.86e-196: tmp = t_1 elif z <= 1.75e-133: tmp = x - (y * (a / t)) elif z <= 1.45e-7: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * a)) tmp = 0.0 if (z <= -4.3e+18) tmp = Float64(x - a); elseif (z <= 1.86e-196) tmp = t_1; elseif (z <= 1.75e-133) tmp = Float64(x - Float64(y * Float64(a / t))); elseif (z <= 1.45e-7) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * a); tmp = 0.0; if (z <= -4.3e+18) tmp = x - a; elseif (z <= 1.86e-196) tmp = t_1; elseif (z <= 1.75e-133) tmp = x - (y * (a / t)); elseif (z <= 1.45e-7) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+18], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.86e-196], t$95$1, If[LessEqual[z, 1.75e-133], N[(x - N[(y * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-7], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot a\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+18}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.86 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-133}:\\
\;\;\;\;x - y \cdot \frac{a}{t}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.3e18 or 1.4499999999999999e-7 < z Initial program 93.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 74.3%
if -4.3e18 < z < 1.8600000000000001e-196 or 1.75000000000000001e-133 < z < 1.4499999999999999e-7Initial program 97.6%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in t around 0 81.1%
Taylor expanded in z around 0 81.8%
if 1.8600000000000001e-196 < z < 1.75000000000000001e-133Initial program 99.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 84.9%
Taylor expanded in y around inf 85.2%
associate-*r/90.2%
Applied egg-rr90.2%
*-commutative90.2%
associate-*l/85.2%
associate-*r/90.2%
*-commutative90.2%
Simplified90.2%
Final simplification79.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y a))))
(if (<= z -1.6e+21)
(- x a)
(if (<= z 1.85e-196)
t_1
(if (<= z 3.2e-109)
(- x (/ (* y a) t))
(if (<= z 1.45e-7) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * a);
double tmp;
if (z <= -1.6e+21) {
tmp = x - a;
} else if (z <= 1.85e-196) {
tmp = t_1;
} else if (z <= 3.2e-109) {
tmp = x - ((y * a) / t);
} else if (z <= 1.45e-7) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x - (y * a)
if (z <= (-1.6d+21)) then
tmp = x - a
else if (z <= 1.85d-196) then
tmp = t_1
else if (z <= 3.2d-109) then
tmp = x - ((y * a) / t)
else if (z <= 1.45d-7) then
tmp = t_1
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 t_1 = x - (y * a);
double tmp;
if (z <= -1.6e+21) {
tmp = x - a;
} else if (z <= 1.85e-196) {
tmp = t_1;
} else if (z <= 3.2e-109) {
tmp = x - ((y * a) / t);
} else if (z <= 1.45e-7) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * a) tmp = 0 if z <= -1.6e+21: tmp = x - a elif z <= 1.85e-196: tmp = t_1 elif z <= 3.2e-109: tmp = x - ((y * a) / t) elif z <= 1.45e-7: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * a)) tmp = 0.0 if (z <= -1.6e+21) tmp = Float64(x - a); elseif (z <= 1.85e-196) tmp = t_1; elseif (z <= 3.2e-109) tmp = Float64(x - Float64(Float64(y * a) / t)); elseif (z <= 1.45e-7) tmp = t_1; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * a); tmp = 0.0; if (z <= -1.6e+21) tmp = x - a; elseif (z <= 1.85e-196) tmp = t_1; elseif (z <= 3.2e-109) tmp = x - ((y * a) / t); elseif (z <= 1.45e-7) tmp = t_1; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+21], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.85e-196], t$95$1, If[LessEqual[z, 3.2e-109], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-7], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot a\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+21}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-109}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.6e21 or 1.4499999999999999e-7 < z Initial program 93.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 74.3%
if -1.6e21 < z < 1.85000000000000005e-196 or 3.2000000000000002e-109 < z < 1.4499999999999999e-7Initial program 99.1%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in t around 0 81.8%
Taylor expanded in z around 0 82.5%
if 1.85000000000000005e-196 < z < 3.2000000000000002e-109Initial program 91.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 84.5%
Taylor expanded in y around inf 84.8%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+115) (not (<= z 1.02e+27))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+115) || !(z <= 1.02e+27)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
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 <= (-3.7d+115)) .or. (.not. (z <= 1.02d+27))) then
tmp = x - a
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+115) || !(z <= 1.02e+27)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+115) or not (z <= 1.02e+27): tmp = x - a else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+115) || !(z <= 1.02e+27)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.7e+115) || ~((z <= 1.02e+27))) tmp = x - a; else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+115], N[Not[LessEqual[z, 1.02e+27]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+115} \lor \neg \left(z \leq 1.02 \cdot 10^{+27}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -3.70000000000000006e115 or 1.0199999999999999e27 < z Initial program 92.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 79.1%
if -3.70000000000000006e115 < z < 1.0199999999999999e27Initial program 98.1%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around 0 91.4%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.8e+115) (- x a) (if (<= z 6e+25) (+ x (* a (/ y (- -1.0 t)))) (+ x (/ (- y z) (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e+115) {
tmp = x - a;
} else if (z <= 6e+25) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (z / 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 <= (-6.8d+115)) then
tmp = x - a
else if (z <= 6d+25) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + ((y - z) / (z / 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 <= -6.8e+115) {
tmp = x - a;
} else if (z <= 6e+25) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e+115: tmp = x - a elif z <= 6e+25: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + ((y - z) / (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e+115) tmp = Float64(x - a); elseif (z <= 6e+25) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.8e+115) tmp = x - a; elseif (z <= 6e+25) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + ((y - z) / (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e+115], N[(x - a), $MachinePrecision], If[LessEqual[z, 6e+25], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+115}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+25}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\end{array}
\end{array}
if z < -6.8000000000000001e115Initial program 88.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.9%
if -6.8000000000000001e115 < z < 6.00000000000000011e25Initial program 98.1%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around 0 91.4%
if 6.00000000000000011e25 < z Initial program 95.5%
Taylor expanded in z around inf 86.7%
associate-*r/86.7%
neg-mul-186.7%
Simplified86.7%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.8e-86) (+ x (* z (/ a (- (+ t 1.0) z)))) (if (<= z 8e+25) (+ x (* a (/ y (- -1.0 t)))) (+ x (/ (- y z) (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e-86) {
tmp = x + (z * (a / ((t + 1.0) - z)));
} else if (z <= 8e+25) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (z / 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 <= (-2.8d-86)) then
tmp = x + (z * (a / ((t + 1.0d0) - z)))
else if (z <= 8d+25) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + ((y - z) / (z / 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 <= -2.8e-86) {
tmp = x + (z * (a / ((t + 1.0) - z)));
} else if (z <= 8e+25) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.8e-86: tmp = x + (z * (a / ((t + 1.0) - z))) elif z <= 8e+25: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + ((y - z) / (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e-86) tmp = Float64(x + Float64(z * Float64(a / Float64(Float64(t + 1.0) - z)))); elseif (z <= 8e+25) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.8e-86) tmp = x + (z * (a / ((t + 1.0) - z))); elseif (z <= 8e+25) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + ((y - z) / (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e-86], N[(x + N[(z * N[(a / N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+25], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-86}:\\
\;\;\;\;x + z \cdot \frac{a}{\left(t + 1\right) - z}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+25}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\end{array}
\end{array}
if z < -2.80000000000000009e-86Initial program 93.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 67.2%
mul-1-neg67.2%
*-commutative67.2%
associate--l+67.2%
+-commutative67.2%
associate-*r/81.2%
distribute-rgt-neg-in81.2%
distribute-neg-frac281.2%
+-commutative81.2%
associate--l+81.2%
Simplified81.2%
if -2.80000000000000009e-86 < z < 8.00000000000000072e25Initial program 97.7%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in z around 0 95.9%
if 8.00000000000000072e25 < z Initial program 95.5%
Taylor expanded in z around inf 86.7%
associate-*r/86.7%
neg-mul-186.7%
Simplified86.7%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.6e+21) (not (<= z 1.45e-7))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.6e+21) || !(z <= 1.45e-7)) {
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 <= (-8.6d+21)) .or. (.not. (z <= 1.45d-7))) 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 <= -8.6e+21) || !(z <= 1.45e-7)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.6e+21) or not (z <= 1.45e-7): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.6e+21) || !(z <= 1.45e-7)) 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 <= -8.6e+21) || ~((z <= 1.45e-7))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.6e+21], N[Not[LessEqual[z, 1.45e-7]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+21} \lor \neg \left(z \leq 1.45 \cdot 10^{-7}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -8.6e21 or 1.4499999999999999e-7 < z Initial program 93.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 74.3%
if -8.6e21 < z < 1.4499999999999999e-7Initial program 97.9%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in t around 0 79.4%
Taylor expanded in z around 0 80.0%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e-84) (not (<= z 1e+34))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e-84) || !(z <= 1e+34)) {
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.15d-84)) .or. (.not. (z <= 1d+34))) 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.15e-84) || !(z <= 1e+34)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e-84) or not (z <= 1e+34): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e-84) || !(z <= 1e+34)) 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.15e-84) || ~((z <= 1e+34))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e-84], N[Not[LessEqual[z, 1e+34]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-84} \lor \neg \left(z \leq 10^{+34}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.1499999999999999e-84 or 9.99999999999999946e33 < z Initial program 94.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 75.2%
if -1.1499999999999999e-84 < z < 9.99999999999999946e33Initial program 97.7%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in x around inf 61.0%
Final simplification67.7%
(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 96.2%
associate-/r/99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.16e-281) x (if (<= x 1.18e-151) (- a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.16e-281) {
tmp = x;
} else if (x <= 1.18e-151) {
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 <= (-1.16d-281)) then
tmp = x
else if (x <= 1.18d-151) 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 <= -1.16e-281) {
tmp = x;
} else if (x <= 1.18e-151) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.16e-281: tmp = x elif x <= 1.18e-151: tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.16e-281) tmp = x; elseif (x <= 1.18e-151) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.16e-281) tmp = x; elseif (x <= 1.18e-151) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.16e-281], x, If[LessEqual[x, 1.18e-151], (-a), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.16 \cdot 10^{-281}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.18 \cdot 10^{-151}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.15999999999999999e-281 or 1.18000000000000002e-151 < x Initial program 97.4%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in x around inf 64.4%
if -1.15999999999999999e-281 < x < 1.18000000000000002e-151Initial program 90.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 54.4%
Taylor expanded in x around 0 47.9%
associate-*r/63.5%
neg-mul-163.5%
distribute-rgt-neg-in63.5%
distribute-neg-frac263.5%
Simplified63.5%
Taylor expanded in z around inf 41.2%
mul-1-neg41.2%
Simplified41.2%
Final simplification60.0%
(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 96.2%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in x around inf 55.4%
Final simplification55.4%
(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 2024067
(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))))