
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- y z) (+ -1.0 (- z t))) a x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (-1.0 + (z - t))), a, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))), a, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{-1 + \left(z - t\right)}, a, x\right)
\end{array}
Initial program 97.0%
sub-neg97.0%
+-commutative97.0%
associate-/r/98.5%
distribute-lft-neg-in98.5%
fma-define98.5%
distribute-neg-frac298.5%
distribute-neg-in98.5%
sub-neg98.5%
distribute-neg-in98.5%
remove-double-neg98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))))
(if (<= t -9e-9)
t_1
(if (<= t 1.5e-200) (- x (* y a)) (if (<= t 6e-24) (- x a) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double tmp;
if (t <= -9e-9) {
tmp = t_1;
} else if (t <= 1.5e-200) {
tmp = x - (y * a);
} else if (t <= 6e-24) {
tmp = x - a;
} else {
tmp = t_1;
}
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 / t))
if (t <= (-9d-9)) then
tmp = t_1
else if (t <= 1.5d-200) then
tmp = x - (y * a)
else if (t <= 6d-24) then
tmp = x - a
else
tmp = t_1
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 / t));
double tmp;
if (t <= -9e-9) {
tmp = t_1;
} else if (t <= 1.5e-200) {
tmp = x - (y * a);
} else if (t <= 6e-24) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if t <= -9e-9: tmp = t_1 elif t <= 1.5e-200: tmp = x - (y * a) elif t <= 6e-24: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (t <= -9e-9) tmp = t_1; elseif (t <= 1.5e-200) tmp = Float64(x - Float64(y * a)); elseif (t <= 6e-24) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / t)); tmp = 0.0; if (t <= -9e-9) tmp = t_1; elseif (t <= 1.5e-200) tmp = x - (y * a); elseif (t <= 6e-24) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9e-9], t$95$1, If[LessEqual[t, 1.5e-200], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-24], N[(x - a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -9 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-200}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-24}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.99999999999999953e-9 or 5.99999999999999991e-24 < t Initial program 97.3%
associate-/r/97.4%
Simplified97.4%
Taylor expanded in t around inf 82.2%
Taylor expanded in y around inf 81.6%
if -8.99999999999999953e-9 < t < 1.49999999999999997e-200Initial program 97.2%
Taylor expanded in t around 0 97.2%
Taylor expanded in z around 0 72.1%
if 1.49999999999999997e-200 < t < 5.99999999999999991e-24Initial program 95.1%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 78.9%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e-44) (not (<= z 4.5e-18))) (+ x (* a (/ z (- (+ t 1.0) z)))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e-44) || !(z <= 4.5e-18)) {
tmp = x + (a * (z / ((t + 1.0) - z)));
} 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 <= (-8.5d-44)) .or. (.not. (z <= 4.5d-18))) then
tmp = x + (a * (z / ((t + 1.0d0) - z)))
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 <= -8.5e-44) || !(z <= 4.5e-18)) {
tmp = x + (a * (z / ((t + 1.0) - z)));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e-44) or not (z <= 4.5e-18): tmp = x + (a * (z / ((t + 1.0) - z))) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e-44) || !(z <= 4.5e-18)) tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t + 1.0) - z)))); 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 <= -8.5e-44) || ~((z <= 4.5e-18))) tmp = x + (a * (z / ((t + 1.0) - z))); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e-44], N[Not[LessEqual[z, 4.5e-18]], $MachinePrecision]], N[(x + N[(a * N[(z / N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-44} \lor \neg \left(z \leq 4.5 \cdot 10^{-18}\right):\\
\;\;\;\;x + a \cdot \frac{z}{\left(t + 1\right) - z}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -8.5000000000000002e-44 or 4.49999999999999994e-18 < z Initial program 95.5%
sub-neg95.5%
+-commutative95.5%
associate-/r/99.9%
distribute-lft-neg-in99.9%
fma-define99.9%
distribute-neg-frac299.9%
distribute-neg-in99.9%
sub-neg99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 73.7%
mul-1-neg73.7%
unsub-neg73.7%
associate-/l*92.7%
Simplified92.7%
if -8.5000000000000002e-44 < z < 4.49999999999999994e-18Initial program 99.0%
associate-/r/96.4%
Simplified96.4%
Taylor expanded in z around 0 94.6%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.8e+21) (- x a) (if (<= z -8e-167) x (if (<= z 1.4) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e+21) {
tmp = x - a;
} else if (z <= -8e-167) {
tmp = x;
} else if (z <= 1.4) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.8d+21)) then
tmp = x - a
else if (z <= (-8d-167)) then
tmp = x
else if (z <= 1.4d0) then
tmp = x - (y * a)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e+21) {
tmp = x - a;
} else if (z <= -8e-167) {
tmp = x;
} else if (z <= 1.4) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.8e+21: tmp = x - a elif z <= -8e-167: tmp = x elif z <= 1.4: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.8e+21) tmp = Float64(x - a); elseif (z <= -8e-167) tmp = x; elseif (z <= 1.4) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.8e+21) tmp = x - a; elseif (z <= -8e-167) tmp = x; elseif (z <= 1.4) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.8e+21], N[(x - a), $MachinePrecision], If[LessEqual[z, -8e-167], x, If[LessEqual[z, 1.4], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+21}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-167}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.4:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.8e21 or 1.3999999999999999 < z Initial program 94.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.4%
if -7.8e21 < z < -8.00000000000000002e-167Initial program 99.8%
associate-/r/97.2%
Simplified97.2%
Taylor expanded in x around inf 72.3%
if -8.00000000000000002e-167 < z < 1.3999999999999999Initial program 98.9%
Taylor expanded in t around 0 74.2%
Taylor expanded in z around 0 71.8%
Final simplification79.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.6e-34)
(- x a)
(if (<= z -1.35e-166)
(+ x (* a (/ z t)))
(if (<= z 0.0046) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e-34) {
tmp = x - a;
} else if (z <= -1.35e-166) {
tmp = x + (a * (z / t));
} else if (z <= 0.0046) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.6d-34)) then
tmp = x - a
else if (z <= (-1.35d-166)) then
tmp = x + (a * (z / t))
else if (z <= 0.0046d0) then
tmp = x - (y * a)
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e-34) {
tmp = x - a;
} else if (z <= -1.35e-166) {
tmp = x + (a * (z / t));
} else if (z <= 0.0046) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.6e-34: tmp = x - a elif z <= -1.35e-166: tmp = x + (a * (z / t)) elif z <= 0.0046: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.6e-34) tmp = Float64(x - a); elseif (z <= -1.35e-166) tmp = Float64(x + Float64(a * Float64(z / t))); elseif (z <= 0.0046) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.6e-34) tmp = x - a; elseif (z <= -1.35e-166) tmp = x + (a * (z / t)); elseif (z <= 0.0046) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.6e-34], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.35e-166], N[(x + N[(a * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0046], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-34}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-166}:\\
\;\;\;\;x + a \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 0.0046:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -5.59999999999999994e-34 or 0.0045999999999999999 < z Initial program 95.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 85.1%
if -5.59999999999999994e-34 < z < -1.35000000000000003e-166Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
associate-/r/96.0%
distribute-lft-neg-in96.0%
fma-define96.0%
distribute-neg-frac296.0%
distribute-neg-in96.0%
sub-neg96.0%
distribute-neg-in96.0%
remove-double-neg96.0%
+-commutative96.0%
sub-neg96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in y around 0 79.7%
mul-1-neg79.7%
unsub-neg79.7%
associate-/l*79.8%
Simplified79.8%
Taylor expanded in t around inf 75.4%
associate-*r/75.5%
Simplified75.5%
if -1.35000000000000003e-166 < z < 0.0045999999999999999Initial program 98.9%
Taylor expanded in t around 0 74.2%
Taylor expanded in z around 0 71.8%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e+43) (not (<= z 1.45e+39))) (- x a) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e+43) || !(z <= 1.45e+39)) {
tmp = x - 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 <= (-4d+43)) .or. (.not. (z <= 1.45d+39))) then
tmp = x - 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 <= -4e+43) || !(z <= 1.45e+39)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e+43) or not (z <= 1.45e+39): tmp = x - a else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e+43) || !(z <= 1.45e+39)) tmp = Float64(x - 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 <= -4e+43) || ~((z <= 1.45e+39))) tmp = x - a; else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e+43], N[Not[LessEqual[z, 1.45e+39]], $MachinePrecision]], N[(x - a), $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 -4 \cdot 10^{+43} \lor \neg \left(z \leq 1.45 \cdot 10^{+39}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -4.00000000000000006e43 or 1.45000000000000015e39 < z Initial program 94.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 89.9%
if -4.00000000000000006e43 < z < 1.45000000000000015e39Initial program 99.2%
associate-/r/97.2%
Simplified97.2%
Taylor expanded in z around 0 88.1%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.05e+41) (- x a) (if (<= z 2.6) (- x (* a (/ y (+ t 1.0)))) (- (+ x (/ (* y a) z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+41) {
tmp = x - a;
} else if (z <= 2.6) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = (x + ((y * a) / 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 <= (-1.05d+41)) then
tmp = x - a
else if (z <= 2.6d0) then
tmp = x - (a * (y / (t + 1.0d0)))
else
tmp = (x + ((y * a) / 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 <= -1.05e+41) {
tmp = x - a;
} else if (z <= 2.6) {
tmp = x - (a * (y / (t + 1.0)));
} else {
tmp = (x + ((y * a) / z)) - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+41: tmp = x - a elif z <= 2.6: tmp = x - (a * (y / (t + 1.0))) else: tmp = (x + ((y * a) / z)) - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+41) tmp = Float64(x - a); elseif (z <= 2.6) tmp = Float64(x - Float64(a * Float64(y / Float64(t + 1.0)))); else tmp = Float64(Float64(x + Float64(Float64(y * a) / z)) - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+41) tmp = x - a; elseif (z <= 2.6) tmp = x - (a * (y / (t + 1.0))); else tmp = (x + ((y * a) / z)) - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+41], N[(x - a), $MachinePrecision], If[LessEqual[z, 2.6], N[(x - N[(a * N[(y / N[(t + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+41}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 2.6:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{y \cdot a}{z}\right) - a\\
\end{array}
\end{array}
if z < -1.05e41Initial program 96.2%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 90.5%
if -1.05e41 < z < 2.60000000000000009Initial program 99.2%
associate-/r/97.0%
Simplified97.0%
Taylor expanded in z around 0 90.7%
if 2.60000000000000009 < z Initial program 93.9%
Taylor expanded in z around inf 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
Taylor expanded in y around 0 87.3%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.4e+21) (not (<= z 0.019))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.4e+21) || !(z <= 0.019)) {
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 <= (-6.4d+21)) .or. (.not. (z <= 0.019d0))) 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 <= -6.4e+21) || !(z <= 0.019)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.4e+21) or not (z <= 0.019): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.4e+21) || !(z <= 0.019)) 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 <= -6.4e+21) || ~((z <= 0.019))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.4e+21], N[Not[LessEqual[z, 0.019]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+21} \lor \neg \left(z \leq 0.019\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.4e21 or 0.0189999999999999995 < z Initial program 94.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.4%
if -6.4e21 < z < 0.0189999999999999995Initial program 99.1%
associate-/r/96.9%
Simplified96.9%
Taylor expanded in x around inf 55.2%
Final simplification71.3%
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- y z) (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (a * ((y - z) / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + (a * ((y - z) / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((y - z) / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{y - z}{-1 + \left(z - t\right)}
\end{array}
Initial program 97.0%
associate-/r/98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (x y z t a) :precision binary64 (if (<= a 1.36e+231) x (- a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.36e+231) {
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 <= 1.36d+231) 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 <= 1.36e+231) {
tmp = x;
} else {
tmp = -a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1.36e+231: tmp = x else: tmp = -a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.36e+231) tmp = x; else tmp = Float64(-a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 1.36e+231) tmp = x; else tmp = -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.36e+231], x, (-a)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.36 \cdot 10^{+231}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-a\\
\end{array}
\end{array}
if a < 1.35999999999999995e231Initial program 96.8%
associate-/r/98.4%
Simplified98.4%
Taylor expanded in x around inf 61.6%
if 1.35999999999999995e231 < a Initial program 99.6%
Taylor expanded in z around inf 60.2%
associate-*r/60.2%
neg-mul-160.2%
Simplified60.2%
Taylor expanded in x around 0 14.4%
associate-/l*60.5%
Simplified60.5%
Taylor expanded in y around 0 52.9%
neg-mul-152.9%
Simplified52.9%
Final simplification61.2%
(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 97.0%
associate-/r/98.5%
Simplified98.5%
Taylor expanded in x around inf 58.8%
Final simplification58.8%
(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 2024077
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))