
(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 (+ 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 96.9%
associate-/r/99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y a))) (t_2 (- x (/ a (/ t y)))))
(if (<= t -600.0)
t_2
(if (<= t -5.7e-196)
(- x a)
(if (<= t 2.4e-190)
t_1
(if (<= t 1e-44) (- x a) (if (<= t 1.05e-32) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * a);
double t_2 = x - (a / (t / y));
double tmp;
if (t <= -600.0) {
tmp = t_2;
} else if (t <= -5.7e-196) {
tmp = x - a;
} else if (t <= 2.4e-190) {
tmp = t_1;
} else if (t <= 1e-44) {
tmp = x - a;
} else if (t <= 1.05e-32) {
tmp = t_1;
} 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) :: tmp
t_1 = x - (y * a)
t_2 = x - (a / (t / y))
if (t <= (-600.0d0)) then
tmp = t_2
else if (t <= (-5.7d-196)) then
tmp = x - a
else if (t <= 2.4d-190) then
tmp = t_1
else if (t <= 1d-44) then
tmp = x - a
else if (t <= 1.05d-32) then
tmp = t_1
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 - (y * a);
double t_2 = x - (a / (t / y));
double tmp;
if (t <= -600.0) {
tmp = t_2;
} else if (t <= -5.7e-196) {
tmp = x - a;
} else if (t <= 2.4e-190) {
tmp = t_1;
} else if (t <= 1e-44) {
tmp = x - a;
} else if (t <= 1.05e-32) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * a) t_2 = x - (a / (t / y)) tmp = 0 if t <= -600.0: tmp = t_2 elif t <= -5.7e-196: tmp = x - a elif t <= 2.4e-190: tmp = t_1 elif t <= 1e-44: tmp = x - a elif t <= 1.05e-32: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * a)) t_2 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (t <= -600.0) tmp = t_2; elseif (t <= -5.7e-196) tmp = Float64(x - a); elseif (t <= 2.4e-190) tmp = t_1; elseif (t <= 1e-44) tmp = Float64(x - a); elseif (t <= 1.05e-32) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * a); t_2 = x - (a / (t / y)); tmp = 0.0; if (t <= -600.0) tmp = t_2; elseif (t <= -5.7e-196) tmp = x - a; elseif (t <= 2.4e-190) tmp = t_1; elseif (t <= 1e-44) tmp = x - a; elseif (t <= 1.05e-32) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -600.0], t$95$2, If[LessEqual[t, -5.7e-196], N[(x - a), $MachinePrecision], If[LessEqual[t, 2.4e-190], t$95$1, If[LessEqual[t, 1e-44], N[(x - a), $MachinePrecision], If[LessEqual[t, 1.05e-32], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot a\\
t_2 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -600:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -5.7 \cdot 10^{-196}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-190}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 10^{-44}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -600 or 1.05e-32 < t Initial program 95.2%
associate-/r/99.2%
Simplified99.2%
*-commutative99.2%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in z around 0 87.9%
Taylor expanded in t around inf 87.2%
if -600 < t < -5.7000000000000002e-196 or 2.4e-190 < t < 9.99999999999999953e-45Initial program 98.2%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around inf 68.2%
if -5.7000000000000002e-196 < t < 2.4e-190 or 9.99999999999999953e-45 < t < 1.05e-32Initial program 99.9%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around 0 82.4%
Final simplification81.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (/ z (- 1.0 z))))) (t_2 (- x (/ a (/ t y)))))
(if (<= t -4.4e+34)
t_2
(if (<= t -1.95e-197)
t_1
(if (<= t 3.7e-190) (- x (* y a)) (if (<= t 2.8e-37) t_1 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 / y));
double tmp;
if (t <= -4.4e+34) {
tmp = t_2;
} else if (t <= -1.95e-197) {
tmp = t_1;
} else if (t <= 3.7e-190) {
tmp = x - (y * a);
} else if (t <= 2.8e-37) {
tmp = t_1;
} 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) :: tmp
t_1 = x + (a * (z / (1.0d0 - z)))
t_2 = x - (a / (t / y))
if (t <= (-4.4d+34)) then
tmp = t_2
else if (t <= (-1.95d-197)) then
tmp = t_1
else if (t <= 3.7d-190) then
tmp = x - (y * a)
else if (t <= 2.8d-37) then
tmp = t_1
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 / y));
double tmp;
if (t <= -4.4e+34) {
tmp = t_2;
} else if (t <= -1.95e-197) {
tmp = t_1;
} else if (t <= 3.7e-190) {
tmp = x - (y * a);
} else if (t <= 2.8e-37) {
tmp = t_1;
} 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 / y)) tmp = 0 if t <= -4.4e+34: tmp = t_2 elif t <= -1.95e-197: tmp = t_1 elif t <= 3.7e-190: tmp = x - (y * a) elif t <= 2.8e-37: tmp = t_1 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(a / Float64(t / y))) tmp = 0.0 if (t <= -4.4e+34) tmp = t_2; elseif (t <= -1.95e-197) tmp = t_1; elseif (t <= 3.7e-190) tmp = Float64(x - Float64(y * a)); elseif (t <= 2.8e-37) tmp = t_1; 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 / y)); tmp = 0.0; if (t <= -4.4e+34) tmp = t_2; elseif (t <= -1.95e-197) tmp = t_1; elseif (t <= 3.7e-190) tmp = x - (y * a); elseif (t <= 2.8e-37) tmp = t_1; 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[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.4e+34], t$95$2, If[LessEqual[t, -1.95e-197], t$95$1, If[LessEqual[t, 3.7e-190], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e-37], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \frac{z}{1 - z}\\
t_2 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.95 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-190}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -4.4000000000000005e34 or 2.8000000000000001e-37 < t Initial program 95.6%
associate-/r/99.2%
Simplified99.2%
*-commutative99.2%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in z around 0 88.7%
Taylor expanded in t around inf 87.8%
if -4.4000000000000005e34 < t < -1.95e-197 or 3.7000000000000002e-190 < t < 2.8000000000000001e-37Initial program 97.1%
Taylor expanded in t around 0 95.7%
Taylor expanded in y around 0 67.7%
sub-neg67.7%
mul-1-neg67.7%
remove-double-neg67.7%
associate-/l*79.5%
Simplified79.5%
if -1.95e-197 < t < 3.7000000000000002e-190Initial program 99.9%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around 0 81.1%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.3e+38) (not (<= t 11500000000.0))) (+ x (* a (/ (- z y) t))) (+ x (/ (- z y) (/ (- 1.0 z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.3e+38) || !(t <= 11500000000.0)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + ((z - y) / ((1.0 - 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 ((t <= (-2.3d+38)) .or. (.not. (t <= 11500000000.0d0))) then
tmp = x + (a * ((z - y) / t))
else
tmp = x + ((z - y) / ((1.0d0 - 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 ((t <= -2.3e+38) || !(t <= 11500000000.0)) {
tmp = x + (a * ((z - y) / t));
} else {
tmp = x + ((z - y) / ((1.0 - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.3e+38) or not (t <= 11500000000.0): tmp = x + (a * ((z - y) / t)) else: tmp = x + ((z - y) / ((1.0 - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.3e+38) || !(t <= 11500000000.0)) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(1.0 - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.3e+38) || ~((t <= 11500000000.0))) tmp = x + (a * ((z - y) / t)); else tmp = x + ((z - y) / ((1.0 - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.3e+38], N[Not[LessEqual[t, 11500000000.0]], $MachinePrecision]], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(1.0 - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+38} \lor \neg \left(t \leq 11500000000\right):\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{1 - z}{a}}\\
\end{array}
\end{array}
if t < -2.3000000000000001e38 or 1.15e10 < t Initial program 95.3%
associate-/r/99.1%
Simplified99.1%
Taylor expanded in t around inf 92.1%
if -2.3000000000000001e38 < t < 1.15e10Initial program 98.4%
Taylor expanded in t around 0 97.7%
Final simplification94.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.3e+44) (not (<= z 1.1e+14))) (+ x (- (* a (/ y z)) a)) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.3e+44) || !(z <= 1.1e+14)) {
tmp = x + ((a * (y / z)) - 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.3d+44)) .or. (.not. (z <= 1.1d+14))) then
tmp = x + ((a * (y / z)) - 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.3e+44) || !(z <= 1.1e+14)) {
tmp = x + ((a * (y / z)) - a);
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.3e+44) or not (z <= 1.1e+14): tmp = x + ((a * (y / z)) - a) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.3e+44) || !(z <= 1.1e+14)) tmp = Float64(x + Float64(Float64(a * Float64(y / z)) - 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.3e+44) || ~((z <= 1.1e+14))) tmp = x + ((a * (y / z)) - 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.3e+44], N[Not[LessEqual[z, 1.1e+14]], $MachinePrecision]], N[(x + N[(N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision] - a), $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.3 \cdot 10^{+44} \lor \neg \left(z \leq 1.1 \cdot 10^{+14}\right):\\
\;\;\;\;x + \left(a \cdot \frac{y}{z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -1.3e44 or 1.1e14 < z Initial program 94.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 94.8%
mul-1-neg94.8%
Simplified94.8%
Taylor expanded in y around 0 88.3%
mul-1-neg88.3%
unsub-neg88.3%
associate-/l*94.8%
Simplified94.8%
if -1.3e44 < z < 1.1e14Initial program 99.1%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 92.3%
Final simplification93.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e+43) (not (<= z 440000000000.0))) (+ x (- (/ a (/ z y)) a)) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+43) || !(z <= 440000000000.0)) {
tmp = x + ((a / (z / y)) - 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 <= (-2.1d+43)) .or. (.not. (z <= 440000000000.0d0))) then
tmp = x + ((a / (z / y)) - 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 <= -2.1e+43) || !(z <= 440000000000.0)) {
tmp = x + ((a / (z / y)) - a);
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e+43) or not (z <= 440000000000.0): tmp = x + ((a / (z / y)) - a) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e+43) || !(z <= 440000000000.0)) tmp = Float64(x + Float64(Float64(a / Float64(z / y)) - 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 <= -2.1e+43) || ~((z <= 440000000000.0))) tmp = x + ((a / (z / y)) - a); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e+43], N[Not[LessEqual[z, 440000000000.0]], $MachinePrecision]], N[(x + N[(N[(a / N[(z / y), $MachinePrecision]), $MachinePrecision] - a), $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 -2.1 \cdot 10^{+43} \lor \neg \left(z \leq 440000000000\right):\\
\;\;\;\;x + \left(\frac{a}{\frac{z}{y}} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -2.10000000000000002e43 or 4.4e11 < z Initial program 94.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 94.8%
mul-1-neg94.8%
Simplified94.8%
Taylor expanded in y around 0 88.3%
mul-1-neg88.3%
unsub-neg88.3%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in a around 0 88.3%
associate-*l/94.3%
associate-/r/94.8%
Simplified94.8%
if -2.10000000000000002e43 < z < 4.4e11Initial program 99.1%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 92.3%
Final simplification93.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e+121)
(- x a)
(if (<= z 1.95e-11)
(+ x (* a (/ y (- -1.0 t))))
(+ x (* a (/ z (- 1.0 z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+121) {
tmp = x - a;
} else if (z <= 1.95e-11) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a * (z / (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 <= (-5.2d+121)) then
tmp = x - a
else if (z <= 1.95d-11) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + (a * (z / (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 <= -5.2e+121) {
tmp = x - a;
} else if (z <= 1.95e-11) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + (a * (z / (1.0 - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+121: tmp = x - a elif z <= 1.95e-11: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + (a * (z / (1.0 - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+121) tmp = Float64(x - a); elseif (z <= 1.95e-11) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(a * Float64(z / Float64(1.0 - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+121) tmp = x - a; elseif (z <= 1.95e-11) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + (a * (z / (1.0 - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+121], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.95e-11], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+121}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-11}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{1 - z}\\
\end{array}
\end{array}
if z < -5.1999999999999998e121Initial program 96.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 94.4%
if -5.1999999999999998e121 < z < 1.95000000000000005e-11Initial program 99.2%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 91.4%
if 1.95000000000000005e-11 < z Initial program 92.1%
Taylor expanded in t around 0 90.4%
Taylor expanded in y around 0 68.9%
sub-neg68.9%
mul-1-neg68.9%
remove-double-neg68.9%
associate-/l*83.9%
Simplified83.9%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.1e+33) (not (<= z 1.0))) (- x a) (+ x (* z a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.1e+33) || !(z <= 1.0)) {
tmp = x - a;
} else {
tmp = x + (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 <= (-3.1d+33)) .or. (.not. (z <= 1.0d0))) then
tmp = x - a
else
tmp = x + (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 <= -3.1e+33) || !(z <= 1.0)) {
tmp = x - a;
} else {
tmp = x + (z * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.1e+33) or not (z <= 1.0): tmp = x - a else: tmp = x + (z * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.1e+33) || !(z <= 1.0)) tmp = Float64(x - a); else tmp = Float64(x + Float64(z * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.1e+33) || ~((z <= 1.0))) tmp = x - a; else tmp = x + (z * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.1e+33], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(z * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+33} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot a\\
\end{array}
\end{array}
if z < -3.1e33 or 1 < z Initial program 94.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 82.0%
if -3.1e33 < z < 1Initial program 99.1%
Taylor expanded in t around 0 73.1%
Taylor expanded in y around 0 63.7%
sub-neg63.7%
mul-1-neg63.7%
remove-double-neg63.7%
associate-/l*63.0%
Simplified63.0%
Taylor expanded in z around 0 63.1%
+-commutative63.1%
Simplified63.1%
Final simplification71.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.3e+121) (not (<= z 3.6e-5))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.3e+121) || !(z <= 3.6e-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 <= (-3.3d+121)) .or. (.not. (z <= 3.6d-5))) 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 <= -3.3e+121) || !(z <= 3.6e-5)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.3e+121) or not (z <= 3.6e-5): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.3e+121) || !(z <= 3.6e-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 <= -3.3e+121) || ~((z <= 3.6e-5))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.3e+121], N[Not[LessEqual[z, 3.6e-5]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+121} \lor \neg \left(z \leq 3.6 \cdot 10^{-5}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -3.29999999999999979e121 or 3.60000000000000009e-5 < z Initial program 93.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 86.7%
if -3.29999999999999979e121 < z < 3.60000000000000009e-5Initial program 99.2%
Taylor expanded in t around 0 74.7%
Taylor expanded in z around 0 68.8%
Final simplification75.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5e+66) (not (<= z 54.0))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5e+66) || !(z <= 54.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 <= (-5d+66)) .or. (.not. (z <= 54.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 <= -5e+66) || !(z <= 54.0)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5e+66) or not (z <= 54.0): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5e+66) || !(z <= 54.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 <= -5e+66) || ~((z <= 54.0))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5e+66], N[Not[LessEqual[z, 54.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+66} \lor \neg \left(z \leq 54\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.99999999999999991e66 or 54 < z Initial program 93.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.5%
if -4.99999999999999991e66 < z < 54Initial program 99.1%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in x around inf 60.7%
Final simplification70.9%
(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.9%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in x around inf 60.2%
Final simplification60.2%
(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 2024039
(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))))