
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- 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.2%
associate-/r/98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -38000000000.0) (not (<= z 25000.0))) (+ x (* a (+ -1.0 (/ (+ y (- -1.0 t)) z)))) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -38000000000.0) || !(z <= 25000.0)) {
tmp = x + (a * (-1.0 + ((y + (-1.0 - t)) / 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 <= (-38000000000.0d0)) .or. (.not. (z <= 25000.0d0))) then
tmp = x + (a * ((-1.0d0) + ((y + ((-1.0d0) - t)) / 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 <= -38000000000.0) || !(z <= 25000.0)) {
tmp = x + (a * (-1.0 + ((y + (-1.0 - t)) / z)));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -38000000000.0) or not (z <= 25000.0): tmp = x + (a * (-1.0 + ((y + (-1.0 - t)) / z))) else: tmp = x - (a * (y / (t + 1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -38000000000.0) || !(z <= 25000.0)) tmp = Float64(x + Float64(a * Float64(-1.0 + Float64(Float64(y + Float64(-1.0 - t)) / 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 <= -38000000000.0) || ~((z <= 25000.0))) tmp = x + (a * (-1.0 + ((y + (-1.0 - t)) / z))); else tmp = x - (a * (y / (t + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -38000000000.0], N[Not[LessEqual[z, 25000.0]], $MachinePrecision]], N[(x + N[(a * N[(-1.0 + N[(N[(y + N[(-1.0 - t), $MachinePrecision]), $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 -38000000000 \lor \neg \left(z \leq 25000\right):\\
\;\;\;\;x + a \cdot \left(-1 + \frac{y + \left(-1 - t\right)}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -3.8e10 or 25000 < z Initial program 95.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
associate--l+80.3%
associate-*r/80.3%
associate-*r/80.3%
mul-1-neg80.3%
div-sub80.3%
mul-1-neg80.3%
distribute-lft-out--80.3%
associate-*r/80.3%
mul-1-neg80.3%
unsub-neg80.3%
sub-neg80.3%
mul-1-neg80.3%
distribute-lft-in80.3%
metadata-eval80.3%
mul-1-neg80.3%
unsub-neg80.3%
Simplified80.3%
if -3.8e10 < z < 25000Initial program 99.0%
associate-/r/97.6%
Simplified97.6%
Taylor expanded in z around 0 94.2%
Final simplification86.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e+75)
(- x a)
(if (<= z -3.9e+28)
(+ x (/ z (/ t a)))
(if (<= z 8e-29) (- x (* y a)) (- x a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+75) {
tmp = x - a;
} else if (z <= -3.9e+28) {
tmp = x + (z / (t / a));
} else if (z <= 8e-29) {
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 <= (-1.05d+75)) then
tmp = x - a
else if (z <= (-3.9d+28)) then
tmp = x + (z / (t / a))
else if (z <= 8d-29) 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 <= -1.05e+75) {
tmp = x - a;
} else if (z <= -3.9e+28) {
tmp = x + (z / (t / a));
} else if (z <= 8e-29) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+75: tmp = x - a elif z <= -3.9e+28: tmp = x + (z / (t / a)) elif z <= 8e-29: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+75) tmp = Float64(x - a); elseif (z <= -3.9e+28) tmp = Float64(x + Float64(z / Float64(t / a))); elseif (z <= 8e-29) 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 <= -1.05e+75) tmp = x - a; elseif (z <= -3.9e+28) tmp = x + (z / (t / a)); elseif (z <= 8e-29) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+75], N[(x - a), $MachinePrecision], If[LessEqual[z, -3.9e+28], N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-29], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+75}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+28}:\\
\;\;\;\;x + \frac{z}{\frac{t}{a}}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-29}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.04999999999999999e75 or 7.99999999999999955e-29 < z Initial program 95.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 71.6%
if -1.04999999999999999e75 < z < -3.8999999999999999e28Initial program 99.8%
Taylor expanded in t around inf 74.6%
Taylor expanded in y around 0 74.8%
neg-mul-174.8%
Simplified74.8%
if -3.8999999999999999e28 < z < 7.99999999999999955e-29Initial program 99.0%
associate-/r/97.6%
Simplified97.6%
Taylor expanded in z around 0 93.3%
Taylor expanded in t around 0 70.9%
Final simplification71.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -530000000.0) (not (<= z 2.55e-5))) (- x (/ (- z 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 <= -530000000.0) || !(z <= 2.55e-5)) {
tmp = x - ((z - 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 <= (-530000000.0d0)) .or. (.not. (z <= 2.55d-5))) then
tmp = x - ((z - 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 <= -530000000.0) || !(z <= 2.55e-5)) {
tmp = x - ((z - y) / (z / a));
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -530000000.0) or not (z <= 2.55e-5): tmp = x - ((z - 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 <= -530000000.0) || !(z <= 2.55e-5)) tmp = Float64(x - Float64(Float64(z - y) / Float64(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 <= -530000000.0) || ~((z <= 2.55e-5))) tmp = x - ((z - 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, -530000000.0], N[Not[LessEqual[z, 2.55e-5]], $MachinePrecision]], N[(x - N[(N[(z - y), $MachinePrecision] / N[(z / a), $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 -530000000 \lor \neg \left(z \leq 2.55 \cdot 10^{-5}\right):\\
\;\;\;\;x - \frac{z - y}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -5.3e8 or 2.54999999999999998e-5 < z Initial program 95.5%
Taylor expanded in z around inf 77.7%
associate-*r/77.7%
neg-mul-177.7%
Simplified77.7%
if -5.3e8 < z < 2.54999999999999998e-5Initial program 99.0%
associate-/r/97.6%
Simplified97.6%
Taylor expanded in z around 0 94.2%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.55e+76) (not (<= z 1.2e+64))) (- x a) (- x (* a (/ y (+ t 1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.55e+76) || !(z <= 1.2e+64)) {
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 <= (-2.55d+76)) .or. (.not. (z <= 1.2d+64))) 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 <= -2.55e+76) || !(z <= 1.2e+64)) {
tmp = x - a;
} else {
tmp = x - (a * (y / (t + 1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.55e+76) or not (z <= 1.2e+64): 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 <= -2.55e+76) || !(z <= 1.2e+64)) 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 <= -2.55e+76) || ~((z <= 1.2e+64))) 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, -2.55e+76], N[Not[LessEqual[z, 1.2e+64]], $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 -2.55 \cdot 10^{+76} \lor \neg \left(z \leq 1.2 \cdot 10^{+64}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\
\end{array}
\end{array}
if z < -2.5500000000000001e76 or 1.2e64 < z Initial program 94.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 73.9%
if -2.5500000000000001e76 < z < 1.2e64Initial program 99.2%
associate-/r/98.0%
Simplified98.0%
Taylor expanded in z around 0 85.2%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.9e+148) (not (<= t 7.8e+163))) (+ x (/ z (/ t a))) (+ x (* a (/ y (+ z -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.9e+148) || !(t <= 7.8e+163)) {
tmp = x + (z / (t / a));
} else {
tmp = x + (a * (y / (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 ((t <= (-3.9d+148)) .or. (.not. (t <= 7.8d+163))) then
tmp = x + (z / (t / a))
else
tmp = x + (a * (y / (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 ((t <= -3.9e+148) || !(t <= 7.8e+163)) {
tmp = x + (z / (t / a));
} else {
tmp = x + (a * (y / (z + -1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.9e+148) or not (t <= 7.8e+163): tmp = x + (z / (t / a)) else: tmp = x + (a * (y / (z + -1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.9e+148) || !(t <= 7.8e+163)) tmp = Float64(x + Float64(z / Float64(t / a))); else tmp = Float64(x + Float64(a * Float64(y / Float64(z + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.9e+148) || ~((t <= 7.8e+163))) tmp = x + (z / (t / a)); else tmp = x + (a * (y / (z + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.9e+148], N[Not[LessEqual[t, 7.8e+163]], $MachinePrecision]], N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(y / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{+148} \lor \neg \left(t \leq 7.8 \cdot 10^{+163}\right):\\
\;\;\;\;x + \frac{z}{\frac{t}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{z + -1}\\
\end{array}
\end{array}
if t < -3.90000000000000002e148 or 7.80000000000000047e163 < t Initial program 97.0%
Taylor expanded in t around inf 94.1%
Taylor expanded in y around 0 79.6%
neg-mul-179.6%
Simplified79.6%
if -3.90000000000000002e148 < t < 7.80000000000000047e163Initial program 97.2%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in t around 0 76.5%
Taylor expanded in y around inf 66.5%
associate-/l*68.8%
Simplified68.8%
Final simplification71.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.05e+17) (not (<= z 8e-29))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.05e+17) || !(z <= 8e-29)) {
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 <= (-1.05d+17)) .or. (.not. (z <= 8d-29))) 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 <= -1.05e+17) || !(z <= 8e-29)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.05e+17) or not (z <= 8e-29): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.05e+17) || !(z <= 8e-29)) 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 <= -1.05e+17) || ~((z <= 8e-29))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.05e+17], N[Not[LessEqual[z, 8e-29]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+17} \lor \neg \left(z \leq 8 \cdot 10^{-29}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -1.05e17 or 7.99999999999999955e-29 < z Initial program 95.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 68.3%
if -1.05e17 < z < 7.99999999999999955e-29Initial program 99.0%
associate-/r/97.5%
Simplified97.5%
Taylor expanded in z around 0 94.1%
Taylor expanded in t around 0 71.3%
Final simplification69.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.5e+222) (* a (/ z t)) (if (<= t 4.6e+186) (- x a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+222) {
tmp = a * (z / t);
} else if (t <= 4.6e+186) {
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 (t <= (-5.5d+222)) then
tmp = a * (z / t)
else if (t <= 4.6d+186) 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 (t <= -5.5e+222) {
tmp = a * (z / t);
} else if (t <= 4.6e+186) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e+222: tmp = a * (z / t) elif t <= 4.6e+186: tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e+222) tmp = Float64(a * Float64(z / t)); elseif (t <= 4.6e+186) tmp = Float64(x - a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e+222) tmp = a * (z / t); elseif (t <= 4.6e+186) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e+222], N[(a * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+186], N[(x - a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+222}:\\
\;\;\;\;a \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+186}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.4999999999999999e222Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
associate-/r/96.2%
distribute-rgt-neg-in96.2%
associate-*l/80.5%
associate-/l*99.7%
fma-define99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
distribute-neg-in99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around -inf 45.1%
Taylor expanded in t around inf 44.9%
mul-1-neg44.9%
associate-/l*56.6%
distribute-rgt-neg-in56.6%
Simplified56.6%
Taylor expanded in y around 0 37.3%
associate-/l*45.1%
Simplified45.1%
if -5.4999999999999999e222 < t < 4.60000000000000027e186Initial program 97.0%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around inf 64.0%
if 4.60000000000000027e186 < t Initial program 95.2%
sub-neg95.2%
+-commutative95.2%
associate-/r/95.2%
distribute-rgt-neg-in95.2%
associate-*l/86.0%
associate-/l*95.2%
fma-define95.2%
distribute-frac-neg95.2%
distribute-neg-frac295.2%
distribute-neg-in95.2%
sub-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
+-commutative95.2%
sub-neg95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in a around 0 76.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.2e+210) x (if (<= t 4.6e+188) (- x a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+210) {
tmp = x;
} else if (t <= 4.6e+188) {
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 (t <= (-4.2d+210)) then
tmp = x
else if (t <= 4.6d+188) 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 (t <= -4.2e+210) {
tmp = x;
} else if (t <= 4.6e+188) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e+210: tmp = x elif t <= 4.6e+188: tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+210) tmp = x; elseif (t <= 4.6e+188) tmp = Float64(x - a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e+210) tmp = x; elseif (t <= 4.6e+188) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+210], x, If[LessEqual[t, 4.6e+188], N[(x - a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+210}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+188}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -4.1999999999999997e210 or 4.60000000000000023e188 < t Initial program 98.0%
sub-neg98.0%
+-commutative98.0%
associate-/r/96.0%
distribute-rgt-neg-in96.0%
associate-*l/82.1%
associate-/l*97.8%
fma-define97.9%
distribute-frac-neg97.9%
distribute-neg-frac297.9%
distribute-neg-in97.9%
sub-neg97.9%
distribute-neg-in97.9%
remove-double-neg97.9%
+-commutative97.9%
sub-neg97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in a around 0 58.0%
if -4.1999999999999997e210 < t < 4.60000000000000023e188Initial program 97.0%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around inf 64.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e+142) (not (<= a 4.8e+121))) (- a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e+142) || !(a <= 4.8e+121)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3d+142)) .or. (.not. (a <= 4.8d+121))) then
tmp = -a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e+142) || !(a <= 4.8e+121)) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e+142) or not (a <= 4.8e+121): tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e+142) || !(a <= 4.8e+121)) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3e+142) || ~((a <= 4.8e+121))) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e+142], N[Not[LessEqual[a, 4.8e+121]], $MachinePrecision]], (-a), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+142} \lor \neg \left(a \leq 4.8 \cdot 10^{+121}\right):\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.99999999999999975e142 or 4.8e121 < a Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
associate-/r/96.1%
distribute-rgt-neg-in96.1%
associate-*l/52.3%
associate-/l*99.8%
fma-define99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
distribute-neg-in99.8%
sub-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around -inf 44.1%
Taylor expanded in z around inf 32.6%
neg-mul-132.6%
Simplified32.6%
if -2.99999999999999975e142 < a < 4.8e121Initial program 96.0%
sub-neg96.0%
+-commutative96.0%
associate-/r/99.9%
distribute-rgt-neg-in99.9%
associate-*l/95.6%
associate-/l*97.0%
fma-define97.0%
distribute-frac-neg97.0%
distribute-neg-frac297.0%
distribute-neg-in97.0%
sub-neg97.0%
distribute-neg-in97.0%
remove-double-neg97.0%
+-commutative97.0%
sub-neg97.0%
metadata-eval97.0%
Simplified97.0%
Taylor expanded in a around 0 65.0%
Final simplification55.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 97.2%
sub-neg97.2%
+-commutative97.2%
associate-/r/98.8%
distribute-rgt-neg-in98.8%
associate-*l/82.7%
associate-/l*97.8%
fma-define97.8%
distribute-frac-neg97.8%
distribute-neg-frac297.8%
distribute-neg-in97.8%
sub-neg97.8%
distribute-neg-in97.8%
remove-double-neg97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
Simplified97.8%
Taylor expanded in a around 0 49.6%
(FPCore (x y z t a) :precision binary64 a)
double code(double x, double y, double z, double t, double a) {
return 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 = a
end function
public static double code(double x, double y, double z, double t, double a) {
return a;
}
def code(x, y, z, t, a): return a
function code(x, y, z, t, a) return a end
function tmp = code(x, y, z, t, a) tmp = a; end
code[x_, y_, z_, t_, a_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 97.2%
sub-neg97.2%
+-commutative97.2%
associate-/r/98.8%
distribute-rgt-neg-in98.8%
associate-*l/82.7%
associate-/l*97.8%
fma-define97.8%
distribute-frac-neg97.8%
distribute-neg-frac297.8%
distribute-neg-in97.8%
sub-neg97.8%
distribute-neg-in97.8%
remove-double-neg97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
Simplified97.8%
Taylor expanded in a around -inf 37.3%
Taylor expanded in z around inf 18.0%
neg-mul-118.0%
Simplified18.0%
neg-sub018.0%
sub-neg18.0%
add-sqr-sqrt7.4%
sqrt-unprod6.9%
sqr-neg6.9%
sqrt-unprod1.7%
add-sqr-sqrt3.4%
Applied egg-rr3.4%
Taylor expanded in a around 0 3.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 2024172
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))