
(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 11 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) (+ (- z t) -1.0)) a x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / ((z - t) + -1.0)), a, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(Float64(z - t) + -1.0)), a, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{\left(z - t\right) + -1}, a, x\right)
\end{array}
Initial program 96.1%
sub-neg96.1%
+-commutative96.1%
associate-/r/98.8%
distribute-lft-neg-in98.8%
fma-define98.8%
distribute-neg-frac298.8%
distribute-neg-in98.8%
sub-neg98.8%
distribute-neg-in98.8%
remove-double-neg98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- (* a (/ y z)) a))))
(if (<= z -2.1e+39)
t_1
(if (<= z 3.45e+31)
(+ x (* a (/ y (- -1.0 t))))
(if (or (<= z 5.8e+90) (not (<= z 1.4e+140)))
t_1
(+ x (* a (/ (- z y) t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((a * (y / z)) - a);
double tmp;
if (z <= -2.1e+39) {
tmp = t_1;
} else if (z <= 3.45e+31) {
tmp = x + (a * (y / (-1.0 - t)));
} else if ((z <= 5.8e+90) || !(z <= 1.4e+140)) {
tmp = t_1;
} else {
tmp = x + (a * ((z - y) / 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) :: t_1
real(8) :: tmp
t_1 = x + ((a * (y / z)) - a)
if (z <= (-2.1d+39)) then
tmp = t_1
else if (z <= 3.45d+31) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else if ((z <= 5.8d+90) .or. (.not. (z <= 1.4d+140))) then
tmp = t_1
else
tmp = x + (a * ((z - y) / t))
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)) - a);
double tmp;
if (z <= -2.1e+39) {
tmp = t_1;
} else if (z <= 3.45e+31) {
tmp = x + (a * (y / (-1.0 - t)));
} else if ((z <= 5.8e+90) || !(z <= 1.4e+140)) {
tmp = t_1;
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((a * (y / z)) - a) tmp = 0 if z <= -2.1e+39: tmp = t_1 elif z <= 3.45e+31: tmp = x + (a * (y / (-1.0 - t))) elif (z <= 5.8e+90) or not (z <= 1.4e+140): tmp = t_1 else: tmp = x + (a * ((z - y) / t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(a * Float64(y / z)) - a)) tmp = 0.0 if (z <= -2.1e+39) tmp = t_1; elseif (z <= 3.45e+31) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); elseif ((z <= 5.8e+90) || !(z <= 1.4e+140)) tmp = t_1; else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((a * (y / z)) - a); tmp = 0.0; if (z <= -2.1e+39) tmp = t_1; elseif (z <= 3.45e+31) tmp = x + (a * (y / (-1.0 - t))); elseif ((z <= 5.8e+90) || ~((z <= 1.4e+140))) tmp = t_1; else tmp = x + (a * ((z - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+39], t$95$1, If[LessEqual[z, 3.45e+31], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 5.8e+90], N[Not[LessEqual[z, 1.4e+140]], $MachinePrecision]], t$95$1, N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(a \cdot \frac{y}{z} - a\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.45 \cdot 10^{+31}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+90} \lor \neg \left(z \leq 1.4 \cdot 10^{+140}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\end{array}
\end{array}
if z < -2.0999999999999999e39 or 3.4499999999999999e31 < z < 5.8000000000000003e90 or 1.39999999999999991e140 < z Initial program 92.4%
Taylor expanded in z around inf 82.6%
associate-*r/82.6%
neg-mul-182.6%
Simplified82.6%
Taylor expanded in y around 0 81.3%
mul-1-neg81.3%
unsub-neg81.3%
associate-/l*89.3%
Simplified89.3%
if -2.0999999999999999e39 < z < 3.4499999999999999e31Initial program 98.6%
associate-/r/97.9%
Simplified97.9%
Taylor expanded in z around 0 89.4%
if 5.8000000000000003e90 < z < 1.39999999999999991e140Initial program 100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around inf 81.4%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.38e+38) (not (<= z 2.2e-126))) (+ x (* a (/ z (- (+ t 1.0) z)))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.38e+38) || !(z <= 2.2e-126)) {
tmp = x + (a * (z / ((t + 1.0) - z)));
} 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 <= (-1.38d+38)) .or. (.not. (z <= 2.2d-126))) then
tmp = x + (a * (z / ((t + 1.0d0) - z)))
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 <= -1.38e+38) || !(z <= 2.2e-126)) {
tmp = x + (a * (z / ((t + 1.0) - z)));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.38e+38) or not (z <= 2.2e-126): tmp = x + (a * (z / ((t + 1.0) - z))) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.38e+38) || !(z <= 2.2e-126)) tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t + 1.0) - z)))); 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 <= -1.38e+38) || ~((z <= 2.2e-126))) tmp = x + (a * (z / ((t + 1.0) - z))); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.38e+38], N[Not[LessEqual[z, 2.2e-126]], $MachinePrecision]], N[(x + N[(a * N[(z / N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -1.38 \cdot 10^{+38} \lor \neg \left(z \leq 2.2 \cdot 10^{-126}\right):\\
\;\;\;\;x + a \cdot \frac{z}{\left(t + 1\right) - z}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.3799999999999999e38 or 2.20000000000000014e-126 < z Initial program 94.0%
sub-neg94.0%
+-commutative94.0%
associate-/r/99.3%
distribute-lft-neg-in99.3%
fma-define99.3%
distribute-neg-frac299.3%
distribute-neg-in99.3%
sub-neg99.3%
distribute-neg-in99.3%
remove-double-neg99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 64.5%
mul-1-neg64.5%
unsub-neg64.5%
associate-/l*86.5%
Simplified86.5%
if -1.3799999999999999e38 < z < 2.20000000000000014e-126Initial program 99.0%
associate-/r/98.1%
Simplified98.1%
Taylor expanded in z around 0 95.4%
Final simplification90.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e+38)
(+ x (/ a (/ (+ (- t z) 1.0) z)))
(if (<= z 2.2e-126)
(+ x (* a (/ y (- -1.0 t))))
(+ x (* a (/ z (- (+ t 1.0) z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+38) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else if (z <= 2.2e-126) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a * (z / ((t + 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 <= (-1.05d+38)) then
tmp = x + (a / (((t - z) + 1.0d0) / z))
else if (z <= 2.2d-126) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + (a * (z / ((t + 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 <= -1.05e+38) {
tmp = x + (a / (((t - z) + 1.0) / z));
} else if (z <= 2.2e-126) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a * (z / ((t + 1.0) - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+38: tmp = x + (a / (((t - z) + 1.0) / z)) elif z <= 2.2e-126: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + (a * (z / ((t + 1.0) - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+38) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / z))); elseif (z <= 2.2e-126) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t + 1.0) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+38) tmp = x + (a / (((t - z) + 1.0) / z)); elseif (z <= 2.2e-126) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + (a * (z / ((t + 1.0) - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+38], N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e-126], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(z / N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{a}{\frac{\left(t - z\right) + 1}{z}}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-126}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{\left(t + 1\right) - z}\\
\end{array}
\end{array}
if z < -1.05e38Initial program 90.2%
sub-neg90.2%
+-commutative90.2%
associate-/r/99.9%
distribute-lft-neg-in99.9%
fma-define99.9%
distribute-neg-frac299.9%
distribute-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 61.3%
mul-1-neg61.3%
unsub-neg61.3%
associate-/l*90.0%
Simplified90.0%
clear-num90.0%
un-div-inv90.1%
+-commutative90.1%
associate--r+90.1%
Applied egg-rr90.1%
if -1.05e38 < z < 2.20000000000000014e-126Initial program 99.0%
associate-/r/98.1%
Simplified98.1%
Taylor expanded in z around 0 95.4%
if 2.20000000000000014e-126 < z Initial program 96.1%
sub-neg96.1%
+-commutative96.1%
associate-/r/99.0%
distribute-lft-neg-in99.0%
fma-define99.0%
distribute-neg-frac299.0%
distribute-neg-in99.0%
sub-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 66.2%
mul-1-neg66.2%
unsub-neg66.2%
associate-/l*84.6%
Simplified84.6%
Final simplification90.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.5e+82)
(- x a)
(if (<= z -1.02e-218)
(- x (* a (/ y t)))
(if (<= z 7.8e+28) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+82) {
tmp = x - a;
} else if (z <= -1.02e-218) {
tmp = x - (a * (y / t));
} else if (z <= 7.8e+28) {
tmp = x - (y * a);
} 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 <= (-3.5d+82)) then
tmp = x - a
else if (z <= (-1.02d-218)) then
tmp = x - (a * (y / t))
else if (z <= 7.8d+28) then
tmp = x - (y * a)
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 <= -3.5e+82) {
tmp = x - a;
} else if (z <= -1.02e-218) {
tmp = x - (a * (y / t));
} else if (z <= 7.8e+28) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+82: tmp = x - a elif z <= -1.02e-218: tmp = x - (a * (y / t)) elif z <= 7.8e+28: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+82) tmp = Float64(x - a); elseif (z <= -1.02e-218) tmp = Float64(x - Float64(a * Float64(y / t))); elseif (z <= 7.8e+28) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+82) tmp = x - a; elseif (z <= -1.02e-218) tmp = x - (a * (y / t)); elseif (z <= 7.8e+28) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+82], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.02e-218], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+28], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+82}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-218}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+28}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -3.5e82 or 7.7999999999999997e28 < z Initial program 92.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 78.9%
if -3.5e82 < z < -1.02e-218Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 71.0%
Taylor expanded in y around inf 70.3%
associate-/l*73.0%
Simplified73.0%
if -1.02e-218 < z < 7.7999999999999997e28Initial program 97.9%
associate-/r/97.0%
Simplified97.0%
*-commutative97.0%
clear-num96.9%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in z around 0 88.4%
Taylor expanded in t around 0 76.4%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+110) (not (<= z 1.4e+140))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+110) || !(z <= 1.4e+140)) {
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 <= (-1.9d+110)) .or. (.not. (z <= 1.4d+140))) 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 <= -1.9e+110) || !(z <= 1.4e+140)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+110) or not (z <= 1.4e+140): 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 <= -1.9e+110) || !(z <= 1.4e+140)) 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 <= -1.9e+110) || ~((z <= 1.4e+140))) 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, -1.9e+110], N[Not[LessEqual[z, 1.4e+140]], $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 -1.9 \cdot 10^{+110} \lor \neg \left(z \leq 1.4 \cdot 10^{+140}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.89999999999999994e110 or 1.39999999999999991e140 < z Initial program 90.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 87.7%
if -1.89999999999999994e110 < z < 1.39999999999999991e140Initial program 98.8%
associate-/r/98.3%
Simplified98.3%
Taylor expanded in z around 0 83.2%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e+159) (and (not (<= a 4.5e+164)) (<= a 9e+246))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e+159) || (!(a <= 4.5e+164) && (a <= 9e+246))) {
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 ((a <= (-3d+159)) .or. (.not. (a <= 4.5d+164)) .and. (a <= 9d+246)) 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 ((a <= -3e+159) || (!(a <= 4.5e+164) && (a <= 9e+246))) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e+159) or (not (a <= 4.5e+164) and (a <= 9e+246)): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e+159) || (!(a <= 4.5e+164) && (a <= 9e+246))) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3e+159) || (~((a <= 4.5e+164)) && (a <= 9e+246))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e+159], And[N[Not[LessEqual[a, 4.5e+164]], $MachinePrecision], LessEqual[a, 9e+246]]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+159} \lor \neg \left(a \leq 4.5 \cdot 10^{+164}\right) \land a \leq 9 \cdot 10^{+246}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.0000000000000002e159 or 4.49999999999999975e164 < a < 9e246Initial program 99.8%
associate-/r/98.0%
Simplified98.0%
Taylor expanded in x around 0 43.3%
mul-1-neg43.3%
associate--l+43.3%
+-commutative43.3%
associate-*l/87.0%
*-commutative87.0%
distribute-rgt-neg-out87.0%
distribute-neg-frac287.0%
+-commutative87.0%
associate--l+87.0%
Simplified87.0%
Taylor expanded in z around inf 39.4%
neg-mul-139.4%
Simplified39.4%
if -3.0000000000000002e159 < a < 4.49999999999999975e164 or 9e246 < a Initial program 95.2%
associate-/r/99.0%
Simplified99.0%
Taylor expanded in x around inf 62.6%
Final simplification57.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+26) (not (<= z 1.2e+29))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+26) || !(z <= 1.2e+29)) {
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 <= (-2.6d+26)) .or. (.not. (z <= 1.2d+29))) 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 <= -2.6e+26) || !(z <= 1.2e+29)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+26) or not (z <= 1.2e+29): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+26) || !(z <= 1.2e+29)) 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 <= -2.6e+26) || ~((z <= 1.2e+29))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+26], N[Not[LessEqual[z, 1.2e+29]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+26} \lor \neg \left(z \leq 1.2 \cdot 10^{+29}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -2.60000000000000002e26 or 1.2e29 < z Initial program 93.3%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 75.5%
if -2.60000000000000002e26 < z < 1.2e29Initial program 98.5%
associate-/r/97.9%
Simplified97.9%
*-commutative97.9%
clear-num97.8%
un-div-inv97.8%
Applied egg-rr97.8%
Taylor expanded in z around 0 89.8%
Taylor expanded in t around 0 72.9%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e+39) (not (<= z 1e+29))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+39) || !(z <= 1e+29)) {
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 <= (-2d+39)) .or. (.not. (z <= 1d+29))) 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 <= -2e+39) || !(z <= 1e+29)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e+39) or not (z <= 1e+29): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e+39) || !(z <= 1e+29)) 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 <= -2e+39) || ~((z <= 1e+29))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e+39], N[Not[LessEqual[z, 1e+29]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+39} \lor \neg \left(z \leq 10^{+29}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.99999999999999988e39 or 9.99999999999999914e28 < z Initial program 93.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 77.1%
if -1.99999999999999988e39 < z < 9.99999999999999914e28Initial program 98.6%
associate-/r/97.9%
Simplified97.9%
Taylor expanded in x around inf 56.5%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- y z) (+ (- z t) -1.0)))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / ((z - t) + -1.0)));
}
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) / ((z - t) + (-1.0d0))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / ((z - t) + -1.0)));
}
def code(x, y, z, t, a): return x + (a * ((y - z) / ((z - t) + -1.0)))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(y - z) / Float64(Float64(z - t) + -1.0)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((y - z) / ((z - t) + -1.0))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{y - z}{\left(z - t\right) + -1}
\end{array}
Initial program 96.1%
associate-/r/98.8%
Simplified98.8%
Final simplification98.8%
(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.1%
associate-/r/98.8%
Simplified98.8%
Taylor expanded in x around inf 52.5%
Final simplification52.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 2024071
(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))))