
(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 (+ x (* a (/ (- z y) (+ (- t z) 1.0)))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 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 * ((z - y) / ((t - z) + 1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.0)));
}
def code(x, y, z, t, a): return x + (a * ((z - y) / ((t - z) + 1.0)))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((z - y) / ((t - z) + 1.0))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{z - y}{\left(t - z\right) + 1}
\end{array}
Initial program 94.0%
associate-/r/99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e+17) (not (<= z 5.2e-50))) (+ x (/ a (+ (/ (+ t 1.0) z) -1.0))) (- x (/ (* y a) (+ t 1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e+17) || !(z <= 5.2e-50)) {
tmp = x + (a / (((t + 1.0) / z) + -1.0));
} else {
tmp = x - ((y * a) / (t + 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 ((z <= (-1.8d+17)) .or. (.not. (z <= 5.2d-50))) then
tmp = x + (a / (((t + 1.0d0) / z) + (-1.0d0)))
else
tmp = x - ((y * a) / (t + 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 ((z <= -1.8e+17) || !(z <= 5.2e-50)) {
tmp = x + (a / (((t + 1.0) / z) + -1.0));
} else {
tmp = x - ((y * a) / (t + 1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e+17) or not (z <= 5.2e-50): tmp = x + (a / (((t + 1.0) / z) + -1.0)) else: tmp = x - ((y * a) / (t + 1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e+17) || !(z <= 5.2e-50)) tmp = Float64(x + Float64(a / Float64(Float64(Float64(t + 1.0) / z) + -1.0))); else tmp = Float64(x - Float64(Float64(y * a) / Float64(t + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.8e+17) || ~((z <= 5.2e-50))) tmp = x + (a / (((t + 1.0) / z) + -1.0)); else tmp = x - ((y * a) / (t + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e+17], N[Not[LessEqual[z, 5.2e-50]], $MachinePrecision]], N[(x + N[(a / N[(N[(N[(t + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * a), $MachinePrecision] / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+17} \lor \neg \left(z \leq 5.2 \cdot 10^{-50}\right):\\
\;\;\;\;x + \frac{a}{\frac{t + 1}{z} + -1}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot a}{t + 1}\\
\end{array}
\end{array}
if z < -1.8e17 or 5.2000000000000003e-50 < z Initial program 91.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 65.4%
sub-neg65.4%
mul-1-neg65.4%
*-commutative65.4%
associate--l+65.4%
+-commutative65.4%
associate-*r/81.7%
remove-double-neg81.7%
associate-*r/65.4%
*-commutative65.4%
+-commutative65.4%
associate--l+65.4%
associate-/l*86.8%
associate--l+86.8%
Simplified86.8%
Taylor expanded in a around 0 65.4%
associate-/l*86.8%
div-sub86.8%
sub-neg86.8%
*-inverses86.8%
metadata-eval86.8%
Simplified86.8%
if -1.8e17 < z < 5.2000000000000003e-50Initial program 98.1%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around 0 91.2%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.6e+123) (not (<= t 6.4e+187))) (+ x (* a (/ (- z y) t))) (+ x (* a (/ (- z y) (- 1.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.6e+123) || !(t <= 6.4e+187)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((z - y) / (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 ((t <= (-4.6d+123)) .or. (.not. (t <= 6.4d+187))) then
tmp = x + (a * ((z - y) / t))
else
tmp = x + (a * ((z - y) / (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 ((t <= -4.6e+123) || !(t <= 6.4e+187)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + (a * ((z - y) / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.6e+123) or not (t <= 6.4e+187): tmp = x + (a * ((z - y) / t)) else: tmp = x + (a * ((z - y) / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.6e+123) || !(t <= 6.4e+187)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.6e+123) || ~((t <= 6.4e+187))) tmp = x + (a * ((z - y) / t)); else tmp = x + (a * ((z - y) / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.6e+123], N[Not[LessEqual[t, 6.4e+187]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{+123} \lor \neg \left(t \leq 6.4 \cdot 10^{+187}\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{1 - z}\\
\end{array}
\end{array}
if t < -4.59999999999999981e123 or 6.39999999999999987e187 < t Initial program 93.0%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in t around inf 94.0%
if -4.59999999999999981e123 < t < 6.39999999999999987e187Initial program 94.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 93.0%
Final simplification93.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.2e+49) (- x a) (if (<= z 1.25) (- x (/ (* y a) (+ t 1.0))) (+ x (/ (- z y) (/ (- z) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.2e+49) {
tmp = x - a;
} else if (z <= 1.25) {
tmp = x - ((y * a) / (t + 1.0));
} else {
tmp = x + ((z - y) / (-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 <= (-9.2d+49)) then
tmp = x - a
else if (z <= 1.25d0) then
tmp = x - ((y * a) / (t + 1.0d0))
else
tmp = x + ((z - y) / (-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 <= -9.2e+49) {
tmp = x - a;
} else if (z <= 1.25) {
tmp = x - ((y * a) / (t + 1.0));
} else {
tmp = x + ((z - y) / (-z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.2e+49: tmp = x - a elif z <= 1.25: tmp = x - ((y * a) / (t + 1.0)) else: tmp = x + ((z - y) / (-z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.2e+49) tmp = Float64(x - a); elseif (z <= 1.25) tmp = Float64(x - Float64(Float64(y * a) / Float64(t + 1.0))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.2e+49) tmp = x - a; elseif (z <= 1.25) tmp = x - ((y * a) / (t + 1.0)); else tmp = x + ((z - y) / (-z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.2e+49], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.25], N[(x - N[(N[(y * a), $MachinePrecision] / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+49}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.25:\\
\;\;\;\;x - \frac{y \cdot a}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\end{array}
\end{array}
if z < -9.20000000000000008e49Initial program 89.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 85.1%
if -9.20000000000000008e49 < z < 1.25Initial program 97.8%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around 0 88.3%
if 1.25 < z Initial program 91.8%
Taylor expanded in z around inf 84.6%
mul-1-neg84.6%
distribute-neg-frac84.6%
Simplified84.6%
Final simplification86.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.9e+16)
(- x a)
(if (<= z 5.5e-62)
(- x (* y a))
(if (<= z 7e+22) (+ x (/ a (/ t z))) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+16) {
tmp = x - a;
} else if (z <= 5.5e-62) {
tmp = x - (y * a);
} else if (z <= 7e+22) {
tmp = x + (a / (t / z));
} 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 <= (-2.9d+16)) then
tmp = x - a
else if (z <= 5.5d-62) then
tmp = x - (y * a)
else if (z <= 7d+22) then
tmp = x + (a / (t / z))
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 <= -2.9e+16) {
tmp = x - a;
} else if (z <= 5.5e-62) {
tmp = x - (y * a);
} else if (z <= 7e+22) {
tmp = x + (a / (t / z));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e+16: tmp = x - a elif z <= 5.5e-62: tmp = x - (y * a) elif z <= 7e+22: tmp = x + (a / (t / z)) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e+16) tmp = Float64(x - a); elseif (z <= 5.5e-62) tmp = Float64(x - Float64(y * a)); elseif (z <= 7e+22) tmp = Float64(x + Float64(a / Float64(t / z))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.9e+16) tmp = x - a; elseif (z <= 5.5e-62) tmp = x - (y * a); elseif (z <= 7e+22) tmp = x + (a / (t / z)); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e+16], N[(x - a), $MachinePrecision], If[LessEqual[z, 5.5e-62], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+22], N[(x + N[(a / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+16}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-62}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{a}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -2.9e16 or 7e22 < z Initial program 91.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.6%
if -2.9e16 < z < 5.50000000000000022e-62Initial program 98.1%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in t around 0 76.0%
Taylor expanded in z around 0 72.5%
if 5.50000000000000022e-62 < z < 7e22Initial program 90.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 64.1%
sub-neg64.1%
mul-1-neg64.1%
*-commutative64.1%
associate--l+64.1%
+-commutative64.1%
associate-*r/64.1%
remove-double-neg64.1%
associate-*r/64.1%
*-commutative64.1%
+-commutative64.1%
associate--l+64.1%
associate-/l*63.9%
associate--l+63.9%
Simplified63.9%
Taylor expanded in t around inf 74.7%
associate-/l*74.6%
Simplified74.6%
Final simplification78.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.06e+17)
(- x a)
(if (<= z 1.52e-61)
(- x (* y a))
(if (<= z 7.4e+22) (+ x (/ (* z a) t)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.06e+17) {
tmp = x - a;
} else if (z <= 1.52e-61) {
tmp = x - (y * a);
} else if (z <= 7.4e+22) {
tmp = x + ((z * a) / 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 <= (-1.06d+17)) then
tmp = x - a
else if (z <= 1.52d-61) then
tmp = x - (y * a)
else if (z <= 7.4d+22) then
tmp = x + ((z * a) / 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 <= -1.06e+17) {
tmp = x - a;
} else if (z <= 1.52e-61) {
tmp = x - (y * a);
} else if (z <= 7.4e+22) {
tmp = x + ((z * a) / t);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.06e+17: tmp = x - a elif z <= 1.52e-61: tmp = x - (y * a) elif z <= 7.4e+22: tmp = x + ((z * a) / t) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.06e+17) tmp = Float64(x - a); elseif (z <= 1.52e-61) tmp = Float64(x - Float64(y * a)); elseif (z <= 7.4e+22) tmp = Float64(x + Float64(Float64(z * a) / t)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.06e+17) tmp = x - a; elseif (z <= 1.52e-61) tmp = x - (y * a); elseif (z <= 7.4e+22) tmp = x + ((z * a) / t); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.06e+17], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.52e-61], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e+22], N[(x + N[(N[(z * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+17}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-61}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{z \cdot a}{t}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.06e17 or 7.3999999999999996e22 < z Initial program 91.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.6%
if -1.06e17 < z < 1.52000000000000003e-61Initial program 98.1%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in t around 0 76.0%
Taylor expanded in z around 0 72.5%
if 1.52000000000000003e-61 < z < 7.3999999999999996e22Initial program 90.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 64.1%
sub-neg64.1%
mul-1-neg64.1%
*-commutative64.1%
associate--l+64.1%
+-commutative64.1%
associate-*r/64.1%
remove-double-neg64.1%
associate-*r/64.1%
*-commutative64.1%
+-commutative64.1%
associate--l+64.1%
associate-/l*63.9%
associate--l+63.9%
Simplified63.9%
Taylor expanded in t around inf 74.7%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.28e+45) (not (<= z 9.8e+22))) (- x a) (- x (/ (* y a) (+ t 1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.28e+45) || !(z <= 9.8e+22)) {
tmp = x - a;
} else {
tmp = x - ((y * a) / (t + 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 ((z <= (-1.28d+45)) .or. (.not. (z <= 9.8d+22))) then
tmp = x - a
else
tmp = x - ((y * a) / (t + 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 ((z <= -1.28e+45) || !(z <= 9.8e+22)) {
tmp = x - a;
} else {
tmp = x - ((y * a) / (t + 1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.28e+45) or not (z <= 9.8e+22): tmp = x - a else: tmp = x - ((y * a) / (t + 1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.28e+45) || !(z <= 9.8e+22)) tmp = Float64(x - a); else tmp = Float64(x - Float64(Float64(y * a) / Float64(t + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.28e+45) || ~((z <= 9.8e+22))) tmp = x - a; else tmp = x - ((y * a) / (t + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.28e+45], N[Not[LessEqual[z, 9.8e+22]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(N[(y * a), $MachinePrecision] / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.28 \cdot 10^{+45} \lor \neg \left(z \leq 9.8 \cdot 10^{+22}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot a}{t + 1}\\
\end{array}
\end{array}
if z < -1.28000000000000002e45 or 9.79999999999999958e22 < z Initial program 90.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.5%
if -1.28000000000000002e45 < z < 9.79999999999999958e22Initial program 97.1%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 87.4%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+44) (not (<= z 7e+22))) (- x a) (- x (/ a (/ t y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+44) || !(z <= 7e+22)) {
tmp = x - a;
} else {
tmp = x - (a / (t / y));
}
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.75d+44)) .or. (.not. (z <= 7d+22))) then
tmp = x - a
else
tmp = x - (a / (t / y))
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.75e+44) || !(z <= 7e+22)) {
tmp = x - a;
} else {
tmp = x - (a / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+44) or not (z <= 7e+22): tmp = x - a else: tmp = x - (a / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+44) || !(z <= 7e+22)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.75e+44) || ~((z <= 7e+22))) tmp = x - a; else tmp = x - (a / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e+44], N[Not[LessEqual[z, 7e+22]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+44} \lor \neg \left(z \leq 7 \cdot 10^{+22}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -1.75e44 or 7e22 < z Initial program 90.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.5%
if -1.75e44 < z < 7e22Initial program 97.1%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 87.4%
Taylor expanded in t around inf 70.7%
associate-/l*72.9%
Simplified72.9%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e+17) (not (<= z 1.0))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+17) || !(z <= 1.0)) {
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 <= (-4.5d+17)) .or. (.not. (z <= 1.0d0))) 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 <= -4.5e+17) || !(z <= 1.0)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e+17) or not (z <= 1.0): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e+17) || !(z <= 1.0)) 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 <= -4.5e+17) || ~((z <= 1.0))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e+17], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+17} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -4.5e17 or 1 < z Initial program 90.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.3%
if -4.5e17 < z < 1Initial program 97.7%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in t around 0 74.2%
Taylor expanded in z around 0 70.3%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1750000.0) (not (<= z 0.046))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1750000.0) || !(z <= 0.046)) {
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 <= (-1750000.0d0)) .or. (.not. (z <= 0.046d0))) 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 <= -1750000.0) || !(z <= 0.046)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1750000.0) or not (z <= 0.046): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1750000.0) || !(z <= 0.046)) 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 <= -1750000.0) || ~((z <= 0.046))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1750000.0], N[Not[LessEqual[z, 0.046]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1750000 \lor \neg \left(z \leq 0.046\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.75e6 or 0.045999999999999999 < z Initial program 91.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.0%
if -1.75e6 < z < 0.045999999999999999Initial program 97.6%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in x around inf 60.2%
Final simplification71.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.6e+244) (not (<= a 2.4e+158))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e+244) || !(a <= 2.4e+158)) {
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 <= (-1.6d+244)) .or. (.not. (a <= 2.4d+158))) 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 <= -1.6e+244) || !(a <= 2.4e+158)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.6e+244) or not (a <= 2.4e+158): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.6e+244) || !(a <= 2.4e+158)) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.6e+244) || ~((a <= 2.4e+158))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.6e+244], N[Not[LessEqual[a, 2.4e+158]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+244} \lor \neg \left(a \leq 2.4 \cdot 10^{+158}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.6000000000000001e244 or 2.40000000000000008e158 < a Initial program 99.8%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in t around 0 80.6%
Taylor expanded in x around 0 29.9%
mul-1-neg29.9%
associate-/l*77.3%
distribute-neg-frac77.3%
Simplified77.3%
Taylor expanded in z around inf 54.5%
mul-1-neg54.5%
Simplified54.5%
if -1.6000000000000001e244 < a < 2.40000000000000008e158Initial program 93.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 64.9%
Final simplification63.3%
(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 94.0%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in x around inf 55.6%
Final simplification55.6%
(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 2023318
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:herbie-target
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))