
(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 14 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 a (/ (- z y) (+ (- t z) 1.0)) x))
double code(double x, double y, double z, double t, double a) {
return fma(a, ((z - y) / ((t - z) + 1.0)), x);
}
function code(x, y, z, t, a) return fma(a, Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)), x) end
code[x_, y_, z_, t_, a_] := N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, \frac{z - y}{\left(t - z\right) + 1}, x\right)
\end{array}
Initial program 95.0%
sub-neg95.0%
+-commutative95.0%
associate-/r/99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
div-sub99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
div-sub99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ a (/ t y)))))
(if (<= z -7e+110)
(- x a)
(if (<= z -0.0085)
(+ x (/ (* a y) z))
(if (<= z -4.5e-198)
t_1
(if (<= z 3.1e-141) (- x (* a y)) (if (<= z 9e+43) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a / (t / y));
double tmp;
if (z <= -7e+110) {
tmp = x - a;
} else if (z <= -0.0085) {
tmp = x + ((a * y) / z);
} else if (z <= -4.5e-198) {
tmp = t_1;
} else if (z <= 3.1e-141) {
tmp = x - (a * y);
} else if (z <= 9e+43) {
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 / (t / y))
if (z <= (-7d+110)) then
tmp = x - a
else if (z <= (-0.0085d0)) then
tmp = x + ((a * y) / z)
else if (z <= (-4.5d-198)) then
tmp = t_1
else if (z <= 3.1d-141) then
tmp = x - (a * y)
else if (z <= 9d+43) 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 / (t / y));
double tmp;
if (z <= -7e+110) {
tmp = x - a;
} else if (z <= -0.0085) {
tmp = x + ((a * y) / z);
} else if (z <= -4.5e-198) {
tmp = t_1;
} else if (z <= 3.1e-141) {
tmp = x - (a * y);
} else if (z <= 9e+43) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a / (t / y)) tmp = 0 if z <= -7e+110: tmp = x - a elif z <= -0.0085: tmp = x + ((a * y) / z) elif z <= -4.5e-198: tmp = t_1 elif z <= 3.1e-141: tmp = x - (a * y) elif z <= 9e+43: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (z <= -7e+110) tmp = Float64(x - a); elseif (z <= -0.0085) tmp = Float64(x + Float64(Float64(a * y) / z)); elseif (z <= -4.5e-198) tmp = t_1; elseif (z <= 3.1e-141) tmp = Float64(x - Float64(a * y)); elseif (z <= 9e+43) 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 / (t / y)); tmp = 0.0; if (z <= -7e+110) tmp = x - a; elseif (z <= -0.0085) tmp = x + ((a * y) / z); elseif (z <= -4.5e-198) tmp = t_1; elseif (z <= 3.1e-141) tmp = x - (a * y); elseif (z <= 9e+43) 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[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+110], N[(x - a), $MachinePrecision], If[LessEqual[z, -0.0085], N[(x + N[(N[(a * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.5e-198], t$95$1, If[LessEqual[z, 3.1e-141], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+43], t$95$1, N[(x - a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+110}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -0.0085:\\
\;\;\;\;x + \frac{a \cdot y}{z}\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-141}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6.9999999999999998e110 or 9e43 < z Initial program 90.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 87.5%
if -6.9999999999999998e110 < z < -0.0085000000000000006Initial program 92.0%
Taylor expanded in z around inf 69.7%
mul-1-neg69.7%
distribute-neg-frac69.7%
Simplified69.7%
Taylor expanded in y around inf 64.8%
associate-*r/64.8%
*-commutative64.8%
mul-1-neg64.8%
distribute-rgt-neg-in64.8%
Simplified64.8%
if -0.0085000000000000006 < z < -4.4999999999999998e-198 or 3.10000000000000027e-141 < z < 9e43Initial program 99.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 57.1%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in y around inf 73.1%
if -4.4999999999999998e-198 < z < 3.10000000000000027e-141Initial program 98.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 74.4%
associate-/l*74.3%
Simplified74.3%
Taylor expanded in z around 0 74.4%
Final simplification78.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- (* a (/ y z)) a))))
(if (<= z -1.92e+74)
t_1
(if (<= z -3.8e+29)
(* a (/ (- z y) (+ (- t z) 1.0)))
(if (or (<= z -6.2e+14) (not (<= z 3.3e+19)))
t_1
(- x (* a (/ y (+ t 1.0)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((a * (y / z)) - a);
double tmp;
if (z <= -1.92e+74) {
tmp = t_1;
} else if (z <= -3.8e+29) {
tmp = a * ((z - y) / ((t - z) + 1.0));
} else if ((z <= -6.2e+14) || !(z <= 3.3e+19)) {
tmp = t_1;
} else {
tmp = x - (a * (y / (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) :: t_1
real(8) :: tmp
t_1 = x + ((a * (y / z)) - a)
if (z <= (-1.92d+74)) then
tmp = t_1
else if (z <= (-3.8d+29)) then
tmp = a * ((z - y) / ((t - z) + 1.0d0))
else if ((z <= (-6.2d+14)) .or. (.not. (z <= 3.3d+19))) then
tmp = t_1
else
tmp = x - (a * (y / (t + 1.0d0)))
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 <= -1.92e+74) {
tmp = t_1;
} else if (z <= -3.8e+29) {
tmp = a * ((z - y) / ((t - z) + 1.0));
} else if ((z <= -6.2e+14) || !(z <= 3.3e+19)) {
tmp = t_1;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((a * (y / z)) - a) tmp = 0 if z <= -1.92e+74: tmp = t_1 elif z <= -3.8e+29: tmp = a * ((z - y) / ((t - z) + 1.0)) elif (z <= -6.2e+14) or not (z <= 3.3e+19): tmp = t_1 else: tmp = x - (a * (y / (t + 1.0))) 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 <= -1.92e+74) tmp = t_1; elseif (z <= -3.8e+29) tmp = Float64(a * Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0))); elseif ((z <= -6.2e+14) || !(z <= 3.3e+19)) tmp = t_1; else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); 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 <= -1.92e+74) tmp = t_1; elseif (z <= -3.8e+29) tmp = a * ((z - y) / ((t - z) + 1.0)); elseif ((z <= -6.2e+14) || ~((z <= 3.3e+19))) tmp = t_1; else tmp = x - (a * (y / (t + 1.0))); 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, -1.92e+74], t$95$1, If[LessEqual[z, -3.8e+29], N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -6.2e+14], N[Not[LessEqual[z, 3.3e+19]], $MachinePrecision]], t$95$1, N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(a \cdot \frac{y}{z} - a\right)\\
\mathbf{if}\;z \leq -1.92 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{+29}:\\
\;\;\;\;a \cdot \frac{z - y}{\left(t - z\right) + 1}\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{+14} \lor \neg \left(z \leq 3.3 \cdot 10^{+19}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -1.92000000000000002e74 or -3.79999999999999971e29 < z < -6.2e14 or 3.3e19 < z Initial program 91.2%
Taylor expanded in z around inf 81.9%
mul-1-neg81.9%
distribute-neg-frac81.9%
Simplified81.9%
Taylor expanded in y around 0 84.6%
mul-1-neg84.6%
unsub-neg84.6%
*-commutative84.6%
associate-/l*89.0%
associate-/r/89.8%
Simplified89.8%
if -1.92000000000000002e74 < z < -3.79999999999999971e29Initial program 91.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around 0 60.0%
mul-1-neg60.0%
associate-*r/83.5%
div-sub83.3%
distribute-rgt-out--83.3%
sub-neg83.3%
+-commutative83.3%
distribute-neg-in83.3%
remove-double-neg83.3%
distribute-lft-neg-in83.3%
distribute-rgt-in83.3%
sub-neg83.3%
div-sub83.5%
associate--l+83.5%
Simplified83.5%
if -6.2e14 < z < 3.3e19Initial program 99.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 93.9%
Final simplification91.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -8.5e+113)
(- x a)
(if (<= z -34.0)
(+ x (/ (* a y) z))
(if (<= z -5.8e-188)
(- x (/ a (/ t y)))
(if (<= z 2.75e-58) (- x (* a y)) (+ x (/ a (+ (/ 1.0 z) -1.0))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+113) {
tmp = x - a;
} else if (z <= -34.0) {
tmp = x + ((a * y) / z);
} else if (z <= -5.8e-188) {
tmp = x - (a / (t / y));
} else if (z <= 2.75e-58) {
tmp = x - (a * y);
} else {
tmp = x + (a / ((1.0 / z) + -1.0));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8.5d+113)) then
tmp = x - a
else if (z <= (-34.0d0)) then
tmp = x + ((a * y) / z)
else if (z <= (-5.8d-188)) then
tmp = x - (a / (t / y))
else if (z <= 2.75d-58) then
tmp = x - (a * y)
else
tmp = x + (a / ((1.0d0 / z) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e+113) {
tmp = x - a;
} else if (z <= -34.0) {
tmp = x + ((a * y) / z);
} else if (z <= -5.8e-188) {
tmp = x - (a / (t / y));
} else if (z <= 2.75e-58) {
tmp = x - (a * y);
} else {
tmp = x + (a / ((1.0 / z) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e+113: tmp = x - a elif z <= -34.0: tmp = x + ((a * y) / z) elif z <= -5.8e-188: tmp = x - (a / (t / y)) elif z <= 2.75e-58: tmp = x - (a * y) else: tmp = x + (a / ((1.0 / z) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e+113) tmp = Float64(x - a); elseif (z <= -34.0) tmp = Float64(x + Float64(Float64(a * y) / z)); elseif (z <= -5.8e-188) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (z <= 2.75e-58) tmp = Float64(x - Float64(a * y)); else tmp = Float64(x + Float64(a / Float64(Float64(1.0 / z) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e+113) tmp = x - a; elseif (z <= -34.0) tmp = x + ((a * y) / z); elseif (z <= -5.8e-188) tmp = x - (a / (t / y)); elseif (z <= 2.75e-58) tmp = x - (a * y); else tmp = x + (a / ((1.0 / z) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e+113], N[(x - a), $MachinePrecision], If[LessEqual[z, -34.0], N[(x + N[(N[(a * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.8e-188], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.75e-58], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(a / N[(N[(1.0 / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+113}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -34:\\
\;\;\;\;x + \frac{a \cdot y}{z}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-188}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{1}{z} + -1}\\
\end{array}
\end{array}
if z < -8.5000000000000001e113Initial program 94.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 89.1%
if -8.5000000000000001e113 < z < -34Initial program 92.0%
Taylor expanded in z around inf 69.7%
mul-1-neg69.7%
distribute-neg-frac69.7%
Simplified69.7%
Taylor expanded in y around inf 64.8%
associate-*r/64.8%
*-commutative64.8%
mul-1-neg64.8%
distribute-rgt-neg-in64.8%
Simplified64.8%
if -34 < z < -5.8000000000000003e-188Initial program 99.6%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around inf 61.9%
associate-/l*78.3%
Simplified78.3%
Taylor expanded in y around inf 78.4%
if -5.8000000000000003e-188 < z < 2.74999999999999998e-58Initial program 98.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 71.2%
associate-/l*71.1%
Simplified71.1%
Taylor expanded in z around 0 72.2%
if 2.74999999999999998e-58 < z Initial program 91.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 66.2%
associate-/l*81.7%
Simplified81.7%
Taylor expanded in y around 0 65.2%
sub-neg65.2%
mul-1-neg65.2%
remove-double-neg65.2%
associate-/l*79.5%
div-sub79.5%
sub-neg79.5%
*-inverses79.5%
metadata-eval79.5%
Simplified79.5%
Final simplification77.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e+110)
(- x a)
(if (<= z -7.5e+73)
(+ x (/ (* a y) z))
(if (<= z -3.8e+29)
(* a (/ (- z y) t))
(if (<= z 6.6e+43) (- x (* a (/ y (+ t 1.0)))) (- x a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+110) {
tmp = x - a;
} else if (z <= -7.5e+73) {
tmp = x + ((a * y) / z);
} else if (z <= -3.8e+29) {
tmp = a * ((z - y) / t);
} else if (z <= 6.6e+43) {
tmp = x - (a * (y / (t + 1.0)));
} 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 <= (-5.5d+110)) then
tmp = x - a
else if (z <= (-7.5d+73)) then
tmp = x + ((a * y) / z)
else if (z <= (-3.8d+29)) then
tmp = a * ((z - y) / t)
else if (z <= 6.6d+43) then
tmp = x - (a * (y / (t + 1.0d0)))
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 <= -5.5e+110) {
tmp = x - a;
} else if (z <= -7.5e+73) {
tmp = x + ((a * y) / z);
} else if (z <= -3.8e+29) {
tmp = a * ((z - y) / t);
} else if (z <= 6.6e+43) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+110: tmp = x - a elif z <= -7.5e+73: tmp = x + ((a * y) / z) elif z <= -3.8e+29: tmp = a * ((z - y) / t) elif z <= 6.6e+43: tmp = x - (a * (y / (t + 1.0))) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+110) tmp = Float64(x - a); elseif (z <= -7.5e+73) tmp = Float64(x + Float64(Float64(a * y) / z)); elseif (z <= -3.8e+29) tmp = Float64(a * Float64(Float64(z - y) / t)); elseif (z <= 6.6e+43) tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e+110) tmp = x - a; elseif (z <= -7.5e+73) tmp = x + ((a * y) / z); elseif (z <= -3.8e+29) tmp = a * ((z - y) / t); elseif (z <= 6.6e+43) tmp = x - (a * (y / (t + 1.0))); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+110], N[(x - a), $MachinePrecision], If[LessEqual[z, -7.5e+73], N[(x + N[(N[(a * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.8e+29], N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e+43], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+110}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+73}:\\
\;\;\;\;x + \frac{a \cdot y}{z}\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{+29}:\\
\;\;\;\;a \cdot \frac{z - y}{t}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+43}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -5.49999999999999996e110 or 6.6000000000000003e43 < z Initial program 90.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 87.5%
if -5.49999999999999996e110 < z < -7.5e73Initial program 90.2%
Taylor expanded in z around inf 90.2%
mul-1-neg90.2%
distribute-neg-frac90.2%
Simplified90.2%
Taylor expanded in y around inf 90.7%
associate-*r/90.7%
*-commutative90.7%
mul-1-neg90.7%
distribute-rgt-neg-in90.7%
Simplified90.7%
if -7.5e73 < z < -3.79999999999999971e29Initial program 89.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 44.8%
associate-/l*73.0%
Simplified73.0%
Taylor expanded in a around inf 53.1%
Taylor expanded in z around 0 53.1%
neg-mul-153.1%
unsub-neg53.1%
div-sub53.2%
Simplified53.2%
if -3.79999999999999971e29 < z < 6.6000000000000003e43Initial program 99.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 92.1%
Final simplification88.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ a (/ t y)))))
(if (<= z -8.5e+124)
(- x a)
(if (<= z -1.95e-199)
t_1
(if (<= z 1.28e-142) (- x (* a y)) (if (<= z 4.1e+40) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a / (t / y));
double tmp;
if (z <= -8.5e+124) {
tmp = x - a;
} else if (z <= -1.95e-199) {
tmp = t_1;
} else if (z <= 1.28e-142) {
tmp = x - (a * y);
} else if (z <= 4.1e+40) {
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 / (t / y))
if (z <= (-8.5d+124)) then
tmp = x - a
else if (z <= (-1.95d-199)) then
tmp = t_1
else if (z <= 1.28d-142) then
tmp = x - (a * y)
else if (z <= 4.1d+40) 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 / (t / y));
double tmp;
if (z <= -8.5e+124) {
tmp = x - a;
} else if (z <= -1.95e-199) {
tmp = t_1;
} else if (z <= 1.28e-142) {
tmp = x - (a * y);
} else if (z <= 4.1e+40) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a / (t / y)) tmp = 0 if z <= -8.5e+124: tmp = x - a elif z <= -1.95e-199: tmp = t_1 elif z <= 1.28e-142: tmp = x - (a * y) elif z <= 4.1e+40: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (z <= -8.5e+124) tmp = Float64(x - a); elseif (z <= -1.95e-199) tmp = t_1; elseif (z <= 1.28e-142) tmp = Float64(x - Float64(a * y)); elseif (z <= 4.1e+40) 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 / (t / y)); tmp = 0.0; if (z <= -8.5e+124) tmp = x - a; elseif (z <= -1.95e-199) tmp = t_1; elseif (z <= 1.28e-142) tmp = x - (a * y); elseif (z <= 4.1e+40) 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[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+124], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.95e-199], t$95$1, If[LessEqual[z, 1.28e-142], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e+40], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+124}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-199}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{-142}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8.4999999999999997e124 or 4.1000000000000002e40 < z Initial program 90.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 88.3%
if -8.4999999999999997e124 < z < -1.9500000000000001e-199 or 1.2799999999999999e-142 < z < 4.1000000000000002e40Initial program 97.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 52.8%
associate-/l*65.1%
Simplified65.1%
Taylor expanded in y around inf 64.3%
if -1.9500000000000001e-199 < z < 1.2799999999999999e-142Initial program 98.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 74.4%
associate-/l*74.3%
Simplified74.3%
Taylor expanded in z around 0 74.4%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.2e+48) (not (<= t 2.8e+96))) (- x (/ a (/ t (- y z)))) (- x (/ a (/ (- 1.0 z) (- y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.2e+48) || !(t <= 2.8e+96)) {
tmp = x - (a / (t / (y - z)));
} else {
tmp = x - (a / ((1.0 - z) / (y - 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 <= (-6.2d+48)) .or. (.not. (t <= 2.8d+96))) then
tmp = x - (a / (t / (y - z)))
else
tmp = x - (a / ((1.0d0 - z) / (y - 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 <= -6.2e+48) || !(t <= 2.8e+96)) {
tmp = x - (a / (t / (y - z)));
} else {
tmp = x - (a / ((1.0 - z) / (y - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.2e+48) or not (t <= 2.8e+96): tmp = x - (a / (t / (y - z))) else: tmp = x - (a / ((1.0 - z) / (y - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.2e+48) || !(t <= 2.8e+96)) tmp = Float64(x - Float64(a / Float64(t / Float64(y - z)))); else tmp = Float64(x - Float64(a / Float64(Float64(1.0 - z) / Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.2e+48) || ~((t <= 2.8e+96))) tmp = x - (a / (t / (y - z))); else tmp = x - (a / ((1.0 - z) / (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.2e+48], N[Not[LessEqual[t, 2.8e+96]], $MachinePrecision]], N[(x - N[(a / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+48} \lor \neg \left(t \leq 2.8 \cdot 10^{+96}\right):\\
\;\;\;\;x - \frac{a}{\frac{t}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\
\end{array}
\end{array}
if t < -6.20000000000000011e48 or 2.8e96 < t Initial program 95.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 67.0%
associate-/l*86.8%
Simplified86.8%
if -6.20000000000000011e48 < t < 2.8e96Initial program 94.7%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in t around 0 84.1%
associate-/l*95.4%
Simplified95.4%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.14e+18) (not (<= z 8.2e+19))) (+ x (- (* a (/ y z)) a)) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.14e+18) || !(z <= 8.2e+19)) {
tmp = x + ((a * (y / z)) - a);
} else {
tmp = x - (a * (y / (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.14d+18)) .or. (.not. (z <= 8.2d+19))) then
tmp = x + ((a * (y / z)) - a)
else
tmp = x - (a * (y / (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.14e+18) || !(z <= 8.2e+19)) {
tmp = x + ((a * (y / z)) - a);
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.14e+18) or not (z <= 8.2e+19): tmp = x + ((a * (y / z)) - a) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.14e+18) || !(z <= 8.2e+19)) tmp = Float64(x + Float64(Float64(a * Float64(y / z)) - a)); else tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.14e+18) || ~((z <= 8.2e+19))) tmp = x + ((a * (y / z)) - a); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.14e+18], N[Not[LessEqual[z, 8.2e+19]], $MachinePrecision]], N[(x + N[(N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.14 \cdot 10^{+18} \lor \neg \left(z \leq 8.2 \cdot 10^{+19}\right):\\
\;\;\;\;x + \left(a \cdot \frac{y}{z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -1.14e18 or 8.2e19 < z Initial program 91.2%
Taylor expanded in z around inf 78.5%
mul-1-neg78.5%
distribute-neg-frac78.5%
Simplified78.5%
Taylor expanded in y around 0 81.0%
mul-1-neg81.0%
unsub-neg81.0%
*-commutative81.0%
associate-/l*85.0%
associate-/r/85.8%
Simplified85.8%
if -1.14e18 < z < 8.2e19Initial program 99.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 93.9%
Final simplification89.7%
(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 95.0%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.5e+37)
(- x a)
(if (<= z -4.4e-261)
x
(if (<= z 1.05e-250) (* a (- y)) (if (<= z 0.0082) x (- x a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.5e+37) {
tmp = x - a;
} else if (z <= -4.4e-261) {
tmp = x;
} else if (z <= 1.05e-250) {
tmp = a * -y;
} else if (z <= 0.0082) {
tmp = x;
} 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 <= (-4.5d+37)) then
tmp = x - a
else if (z <= (-4.4d-261)) then
tmp = x
else if (z <= 1.05d-250) then
tmp = a * -y
else if (z <= 0.0082d0) then
tmp = x
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 <= -4.5e+37) {
tmp = x - a;
} else if (z <= -4.4e-261) {
tmp = x;
} else if (z <= 1.05e-250) {
tmp = a * -y;
} else if (z <= 0.0082) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.5e+37: tmp = x - a elif z <= -4.4e-261: tmp = x elif z <= 1.05e-250: tmp = a * -y elif z <= 0.0082: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.5e+37) tmp = Float64(x - a); elseif (z <= -4.4e-261) tmp = x; elseif (z <= 1.05e-250) tmp = Float64(a * Float64(-y)); elseif (z <= 0.0082) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.5e+37) tmp = x - a; elseif (z <= -4.4e-261) tmp = x; elseif (z <= 1.05e-250) tmp = a * -y; elseif (z <= 0.0082) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+37], N[(x - a), $MachinePrecision], If[LessEqual[z, -4.4e-261], x, If[LessEqual[z, 1.05e-250], N[(a * (-y)), $MachinePrecision], If[LessEqual[z, 0.0082], x, N[(x - a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+37}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-261}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-250}:\\
\;\;\;\;a \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 0.0082:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.49999999999999962e37 or 0.00820000000000000069 < z Initial program 91.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.9%
if -4.49999999999999962e37 < z < -4.4000000000000003e-261 or 1.05e-250 < z < 0.00820000000000000069Initial program 98.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 55.6%
if -4.4000000000000003e-261 < z < 1.05e-250Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 71.3%
associate-/l*71.1%
Simplified71.1%
Taylor expanded in x around 0 59.8%
mul-1-neg59.8%
associate-*l/59.8%
*-commutative59.8%
distribute-rgt-neg-in59.8%
Simplified59.8%
Taylor expanded in z around 0 59.8%
associate-*r*59.8%
mul-1-neg59.8%
Simplified59.8%
Final simplification67.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e+37) (not (<= z 1.3e-7))) (- x a) (- x (* a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+37) || !(z <= 1.3e-7)) {
tmp = x - a;
} else {
tmp = x - (a * 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 <= (-6d+37)) .or. (.not. (z <= 1.3d-7))) then
tmp = x - a
else
tmp = x - (a * 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 <= -6e+37) || !(z <= 1.3e-7)) {
tmp = x - a;
} else {
tmp = x - (a * y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e+37) or not (z <= 1.3e-7): tmp = x - a else: tmp = x - (a * y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e+37) || !(z <= 1.3e-7)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6e+37) || ~((z <= 1.3e-7))) tmp = x - a; else tmp = x - (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6e+37], N[Not[LessEqual[z, 1.3e-7]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+37} \lor \neg \left(z \leq 1.3 \cdot 10^{-7}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot y\\
\end{array}
\end{array}
if z < -6.00000000000000043e37 or 1.29999999999999999e-7 < z Initial program 91.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.3%
if -6.00000000000000043e37 < z < 1.29999999999999999e-7Initial program 99.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 69.8%
associate-/l*69.7%
Simplified69.7%
Taylor expanded in z around 0 65.0%
Final simplification71.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.5e+37) (- x a) (if (<= z 0.049) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.5e+37) {
tmp = x - a;
} else if (z <= 0.049) {
tmp = x;
} 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 <= (-4.5d+37)) then
tmp = x - a
else if (z <= 0.049d0) then
tmp = x
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 <= -4.5e+37) {
tmp = x - a;
} else if (z <= 0.049) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.5e+37: tmp = x - a elif z <= 0.049: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.5e+37) tmp = Float64(x - a); elseif (z <= 0.049) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.5e+37) tmp = x - a; elseif (z <= 0.049) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+37], N[(x - a), $MachinePrecision], If[LessEqual[z, 0.049], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+37}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 0.049:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -4.49999999999999962e37 or 0.049000000000000002 < z Initial program 91.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.9%
if -4.49999999999999962e37 < z < 0.049000000000000002Initial program 99.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 51.6%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.4e+60) (- a) (if (<= a 2.3e+153) x (- a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.4e+60) {
tmp = -a;
} else if (a <= 2.3e+153) {
tmp = x;
} else {
tmp = -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 (a <= (-5.4d+60)) then
tmp = -a
else if (a <= 2.3d+153) then
tmp = x
else
tmp = -a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.4e+60) {
tmp = -a;
} else if (a <= 2.3e+153) {
tmp = x;
} else {
tmp = -a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.4e+60: tmp = -a elif a <= 2.3e+153: tmp = x else: tmp = -a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.4e+60) tmp = Float64(-a); elseif (a <= 2.3e+153) tmp = x; else tmp = Float64(-a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.4e+60) tmp = -a; elseif (a <= 2.3e+153) tmp = x; else tmp = -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.4e+60], (-a), If[LessEqual[a, 2.3e+153], x, (-a)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.4 \cdot 10^{+60}:\\
\;\;\;\;-a\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+153}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-a\\
\end{array}
\end{array}
if a < -5.3999999999999999e60 or 2.3000000000000001e153 < a Initial program 99.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 34.0%
associate-/l*58.3%
Simplified58.3%
Taylor expanded in x around 0 30.6%
mul-1-neg30.6%
associate-*l/54.8%
*-commutative54.8%
distribute-rgt-neg-in54.8%
Simplified54.8%
Taylor expanded in z around inf 31.6%
mul-1-neg31.6%
Simplified31.6%
if -5.3999999999999999e60 < a < 2.3000000000000001e153Initial program 92.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in x around inf 64.5%
Final simplification53.4%
(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 95.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 48.4%
Final simplification48.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 2023192
(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))))