
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* t (+ (/ y (- a z)) (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((y / (a - z)) + (z / (z - 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 + (t * ((y / (a - z)) + (z / (z - a))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((y / (a - z)) + (z / (z - a))));
}
def code(x, y, z, t, a): return x + (t * ((y / (a - z)) + (z / (z - a))))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(y / Float64(a - z)) + Float64(z / Float64(z - a))))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((y / (a - z)) + (z / (z - a)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] + N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \left(\frac{y}{a - z} + \frac{z}{z - a}\right)
\end{array}
Initial program 87.1%
associate-/l*96.6%
Simplified96.6%
*-commutative96.6%
sub-neg96.6%
distribute-lft-in94.2%
Applied egg-rr94.2%
Taylor expanded in t around -inf 98.7%
mul-1-neg98.7%
*-commutative98.7%
distribute-rgt-neg-in98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -85000000.0) (not (<= z 96000000000.0))) (+ x (- t (* y (/ t z)))) (+ x (* (/ y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -85000000.0) || !(z <= 96000000000.0)) {
tmp = x + (t - (y * (t / z)));
} else {
tmp = x + ((y / (a - z)) * 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 <= (-85000000.0d0)) .or. (.not. (z <= 96000000000.0d0))) then
tmp = x + (t - (y * (t / z)))
else
tmp = x + ((y / (a - z)) * 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 <= -85000000.0) || !(z <= 96000000000.0)) {
tmp = x + (t - (y * (t / z)));
} else {
tmp = x + ((y / (a - z)) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -85000000.0) or not (z <= 96000000000.0): tmp = x + (t - (y * (t / z))) else: tmp = x + ((y / (a - z)) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -85000000.0) || !(z <= 96000000000.0)) tmp = Float64(x + Float64(t - Float64(y * Float64(t / z)))); else tmp = Float64(x + Float64(Float64(y / Float64(a - z)) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -85000000.0) || ~((z <= 96000000000.0))) tmp = x + (t - (y * (t / z))); else tmp = x + ((y / (a - z)) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -85000000.0], N[Not[LessEqual[z, 96000000000.0]], $MachinePrecision]], N[(x + N[(t - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -85000000 \lor \neg \left(z \leq 96000000000\right):\\
\;\;\;\;x + \left(t - y \cdot \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a - z} \cdot t\\
\end{array}
\end{array}
if z < -8.5e7 or 9.6e10 < z Initial program 73.8%
associate-/l*97.4%
Simplified97.4%
*-commutative97.4%
sub-neg97.4%
distribute-lft-in97.4%
Applied egg-rr97.4%
Taylor expanded in a around 0 75.8%
mul-1-neg75.8%
unsub-neg75.8%
associate-/l*85.9%
Simplified85.9%
Taylor expanded in t around 0 75.8%
*-commutative75.8%
associate-/l*86.0%
Simplified86.0%
if -8.5e7 < z < 9.6e10Initial program 97.2%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around inf 92.6%
associate-/l*93.3%
Simplified93.3%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -265000000.0) (not (<= z 1.3e+44))) (+ x (- t (* t (/ y z)))) (+ x (* (/ y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -265000000.0) || !(z <= 1.3e+44)) {
tmp = x + (t - (t * (y / z)));
} else {
tmp = x + ((y / (a - z)) * 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 <= (-265000000.0d0)) .or. (.not. (z <= 1.3d+44))) then
tmp = x + (t - (t * (y / z)))
else
tmp = x + ((y / (a - z)) * 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 <= -265000000.0) || !(z <= 1.3e+44)) {
tmp = x + (t - (t * (y / z)));
} else {
tmp = x + ((y / (a - z)) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -265000000.0) or not (z <= 1.3e+44): tmp = x + (t - (t * (y / z))) else: tmp = x + ((y / (a - z)) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -265000000.0) || !(z <= 1.3e+44)) tmp = Float64(x + Float64(t - Float64(t * Float64(y / z)))); else tmp = Float64(x + Float64(Float64(y / Float64(a - z)) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -265000000.0) || ~((z <= 1.3e+44))) tmp = x + (t - (t * (y / z))); else tmp = x + ((y / (a - z)) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -265000000.0], N[Not[LessEqual[z, 1.3e+44]], $MachinePrecision]], N[(x + N[(t - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -265000000 \lor \neg \left(z \leq 1.3 \cdot 10^{+44}\right):\\
\;\;\;\;x + \left(t - t \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a - z} \cdot t\\
\end{array}
\end{array}
if z < -2.65e8 or 1.3e44 < z Initial program 72.1%
associate-/l*97.2%
Simplified97.2%
*-commutative97.2%
sub-neg97.2%
distribute-lft-in97.2%
Applied egg-rr97.2%
Taylor expanded in a around 0 75.3%
mul-1-neg75.3%
unsub-neg75.3%
associate-/l*86.5%
Simplified86.5%
if -2.65e8 < z < 1.3e44Initial program 96.8%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around inf 91.9%
associate-/l*92.5%
Simplified92.5%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e+115) (not (<= z 2.2e+48))) (+ x t) (+ x (* (/ y (- a z)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+115) || !(z <= 2.2e+48)) {
tmp = x + t;
} else {
tmp = x + ((y / (a - z)) * 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+115)) .or. (.not. (z <= 2.2d+48))) then
tmp = x + t
else
tmp = x + ((y / (a - z)) * 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+115) || !(z <= 2.2e+48)) {
tmp = x + t;
} else {
tmp = x + ((y / (a - z)) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e+115) or not (z <= 2.2e+48): tmp = x + t else: tmp = x + ((y / (a - z)) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e+115) || !(z <= 2.2e+48)) tmp = Float64(x + t); else tmp = Float64(x + Float64(Float64(y / Float64(a - z)) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.1e+115) || ~((z <= 2.2e+48))) tmp = x + t; else tmp = x + ((y / (a - z)) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e+115], N[Not[LessEqual[z, 2.2e+48]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+115} \lor \neg \left(z \leq 2.2 \cdot 10^{+48}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a - z} \cdot t\\
\end{array}
\end{array}
if z < -2.10000000000000003e115 or 2.1999999999999999e48 < z Initial program 67.1%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 86.3%
if -2.10000000000000003e115 < z < 2.1999999999999999e48Initial program 95.7%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around inf 87.6%
associate-/l*89.2%
Simplified89.2%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.3e-178) (+ x t) (if (<= z 3.7e-247) (* y (/ t (- a z))) (if (<= z 3600000.0) x (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.3e-178) {
tmp = x + t;
} else if (z <= 3.7e-247) {
tmp = y * (t / (a - z));
} else if (z <= 3600000.0) {
tmp = x;
} else {
tmp = x + 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 <= (-4.3d-178)) then
tmp = x + t
else if (z <= 3.7d-247) then
tmp = y * (t / (a - z))
else if (z <= 3600000.0d0) then
tmp = x
else
tmp = x + 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 <= -4.3e-178) {
tmp = x + t;
} else if (z <= 3.7e-247) {
tmp = y * (t / (a - z));
} else if (z <= 3600000.0) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.3e-178: tmp = x + t elif z <= 3.7e-247: tmp = y * (t / (a - z)) elif z <= 3600000.0: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.3e-178) tmp = Float64(x + t); elseif (z <= 3.7e-247) tmp = Float64(y * Float64(t / Float64(a - z))); elseif (z <= 3600000.0) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.3e-178) tmp = x + t; elseif (z <= 3.7e-247) tmp = y * (t / (a - z)); elseif (z <= 3600000.0) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.3e-178], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.7e-247], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3600000.0], x, N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-178}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-247}:\\
\;\;\;\;y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;z \leq 3600000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -4.3e-178 or 3.6e6 < z Initial program 80.6%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around inf 70.2%
if -4.3e-178 < z < 3.7000000000000001e-247Initial program 92.6%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in y around inf 90.7%
Taylor expanded in x around 0 62.0%
*-commutative62.0%
associate-*r/67.5%
Simplified67.5%
if 3.7000000000000001e-247 < z < 3.6e6Initial program 99.9%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in y around inf 98.1%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around inf 66.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+115) (not (<= z 15800000000.0))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+115) || !(z <= 15800000000.0)) {
tmp = x + t;
} else {
tmp = x + (t * (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 <= (-1.45d+115)) .or. (.not. (z <= 15800000000.0d0))) then
tmp = x + t
else
tmp = x + (t * (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 <= -1.45e+115) || !(z <= 15800000000.0)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e+115) or not (z <= 15800000000.0): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+115) || !(z <= 15800000000.0)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.45e+115) || ~((z <= 15800000000.0))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+115], N[Not[LessEqual[z, 15800000000.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+115} \lor \neg \left(z \leq 15800000000\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.45000000000000002e115 or 1.58e10 < z Initial program 69.8%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in z around inf 83.3%
if -1.45000000000000002e115 < z < 1.58e10Initial program 95.9%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in y around inf 88.1%
associate-/l*89.7%
Simplified89.7%
Taylor expanded in a around inf 76.9%
+-commutative76.9%
associate-/l*79.1%
Simplified79.1%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+115) (not (<= z 118000000.0))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+115) || !(z <= 118000000.0)) {
tmp = x + t;
} else {
tmp = x + (t * (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 <= (-1.45d+115)) .or. (.not. (z <= 118000000.0d0))) then
tmp = x + t
else
tmp = x + (t * (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 <= -1.45e+115) || !(z <= 118000000.0)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e+115) or not (z <= 118000000.0): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+115) || !(z <= 118000000.0)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.45e+115) || ~((z <= 118000000.0))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+115], N[Not[LessEqual[z, 118000000.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+115} \lor \neg \left(z \leq 118000000\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.45000000000000002e115 or 1.18e8 < z Initial program 69.8%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in z around inf 83.3%
if -1.45000000000000002e115 < z < 1.18e8Initial program 95.9%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around 0 76.9%
associate-/l*79.1%
Simplified79.1%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.05e-62) (not (<= z 52000000.0))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.05e-62) || !(z <= 52000000.0)) {
tmp = x + t;
} 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 <= (-2.05d-62)) .or. (.not. (z <= 52000000.0d0))) then
tmp = x + t
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 <= -2.05e-62) || !(z <= 52000000.0)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.05e-62) or not (z <= 52000000.0): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.05e-62) || !(z <= 52000000.0)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.05e-62) || ~((z <= 52000000.0))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.05e-62], N[Not[LessEqual[z, 52000000.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-62} \lor \neg \left(z \leq 52000000\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.05e-62 or 5.2e7 < z Initial program 77.1%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 72.5%
if -2.05e-62 < z < 5.2e7Initial program 96.9%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in y around inf 94.0%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in x around inf 52.7%
Final simplification62.5%
(FPCore (x y z t a) :precision binary64 (- x (* (- y z) (/ t (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) * (t / (z - 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 - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) * (t / (z - a)));
}
def code(x, y, z, t, a): return x - ((y - z) * (t / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) * Float64(t / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) * (t / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(y - z\right) \cdot \frac{t}{z - a}
\end{array}
Initial program 87.1%
associate-/l*96.6%
Simplified96.6%
Final simplification96.6%
(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 87.1%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in y around inf 76.9%
associate-/l*79.3%
Simplified79.3%
Taylor expanded in x around inf 50.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} 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 + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
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 + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024103
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))