
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* a (/ (- 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 98.3%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ a t) (- z y)))))
(if (<= z -1.9e+79)
(- x a)
(if (<= z -7e-96)
t_1
(if (<= z 3.5e-156) (- x (* y a)) (if (<= z 7.5e-40) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((a / t) * (z - y));
double tmp;
if (z <= -1.9e+79) {
tmp = x - a;
} else if (z <= -7e-96) {
tmp = t_1;
} else if (z <= 3.5e-156) {
tmp = x - (y * a);
} else if (z <= 7.5e-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) * (z - y))
if (z <= (-1.9d+79)) then
tmp = x - a
else if (z <= (-7d-96)) then
tmp = t_1
else if (z <= 3.5d-156) then
tmp = x - (y * a)
else if (z <= 7.5d-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) * (z - y));
double tmp;
if (z <= -1.9e+79) {
tmp = x - a;
} else if (z <= -7e-96) {
tmp = t_1;
} else if (z <= 3.5e-156) {
tmp = x - (y * a);
} else if (z <= 7.5e-40) {
tmp = t_1;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((a / t) * (z - y)) tmp = 0 if z <= -1.9e+79: tmp = x - a elif z <= -7e-96: tmp = t_1 elif z <= 3.5e-156: tmp = x - (y * a) elif z <= 7.5e-40: tmp = t_1 else: tmp = x - a return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(a / t) * Float64(z - y))) tmp = 0.0 if (z <= -1.9e+79) tmp = Float64(x - a); elseif (z <= -7e-96) tmp = t_1; elseif (z <= 3.5e-156) tmp = Float64(x - Float64(y * a)); elseif (z <= 7.5e-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) * (z - y)); tmp = 0.0; if (z <= -1.9e+79) tmp = x - a; elseif (z <= -7e-96) tmp = t_1; elseif (z <= 3.5e-156) tmp = x - (y * a); elseif (z <= 7.5e-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[(N[(a / t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+79], N[(x - a), $MachinePrecision], If[LessEqual[z, -7e-96], t$95$1, If[LessEqual[z, 3.5e-156], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-40], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{a}{t} \cdot \left(z - y\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+79}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-156}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.9000000000000001e79 or 7.50000000000000069e-40 < z Initial program 96.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.0%
if -1.9000000000000001e79 < z < -6.9999999999999998e-96 or 3.4999999999999999e-156 < z < 7.50000000000000069e-40Initial program 99.8%
clear-num99.9%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 77.8%
if -6.9999999999999998e-96 < z < 3.4999999999999999e-156Initial program 99.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 83.8%
Taylor expanded in z around 0 80.6%
Final simplification79.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* a (/ z (- (+ t 1.0) z))))))
(if (<= z -5.2e+78)
t_1
(if (<= z 8.5e-52)
(+ x (* a (/ y (- -1.0 t))))
(if (<= z 3.4e+69) t_1 (+ x (* a (/ (- y z) z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a * (z / ((t + 1.0) - z)));
double tmp;
if (z <= -5.2e+78) {
tmp = t_1;
} else if (z <= 8.5e-52) {
tmp = x + (a * (y / (-1.0 - t)));
} else if (z <= 3.4e+69) {
tmp = t_1;
} else {
tmp = x + (a * ((y - z) / 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) :: t_1
real(8) :: tmp
t_1 = x + (a * (z / ((t + 1.0d0) - z)))
if (z <= (-5.2d+78)) then
tmp = t_1
else if (z <= 8.5d-52) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else if (z <= 3.4d+69) then
tmp = t_1
else
tmp = x + (a * ((y - z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a * (z / ((t + 1.0) - z)));
double tmp;
if (z <= -5.2e+78) {
tmp = t_1;
} else if (z <= 8.5e-52) {
tmp = x + (a * (y / (-1.0 - t)));
} else if (z <= 3.4e+69) {
tmp = t_1;
} else {
tmp = x + (a * ((y - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a * (z / ((t + 1.0) - z))) tmp = 0 if z <= -5.2e+78: tmp = t_1 elif z <= 8.5e-52: tmp = x + (a * (y / (-1.0 - t))) elif z <= 3.4e+69: tmp = t_1 else: tmp = x + (a * ((y - z) / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a * Float64(z / Float64(Float64(t + 1.0) - z)))) tmp = 0.0 if (z <= -5.2e+78) tmp = t_1; elseif (z <= 8.5e-52) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); elseif (z <= 3.4e+69) tmp = t_1; else tmp = Float64(x + Float64(a * Float64(Float64(y - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a * (z / ((t + 1.0) - z))); tmp = 0.0; if (z <= -5.2e+78) tmp = t_1; elseif (z <= 8.5e-52) tmp = x + (a * (y / (-1.0 - t))); elseif (z <= 3.4e+69) tmp = t_1; else tmp = x + (a * ((y - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(z / N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+78], t$95$1, If[LessEqual[z, 8.5e-52], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+69], t$95$1, N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot \frac{z}{\left(t + 1\right) - z}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-52}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z}\\
\end{array}
\end{array}
if z < -5.2e78 or 8.50000000000000006e-52 < z < 3.39999999999999986e69Initial program 98.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around 0 93.2%
mul-1-neg93.2%
associate--l+93.2%
+-commutative93.2%
distribute-neg-frac293.2%
+-commutative93.2%
distribute-neg-in93.2%
metadata-eval93.2%
unsub-neg93.2%
associate--r-93.2%
Simplified93.2%
if -5.2e78 < z < 8.50000000000000006e-52Initial program 99.6%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around 0 91.9%
if 3.39999999999999986e69 < z Initial program 94.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 96.2%
mul-1-neg96.2%
Simplified96.2%
Final simplification93.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -9e+37)
(- x a)
(if (<= z -1800000000.0)
(* a (/ y z))
(if (<= z -1.35e-24) x (if (<= z 0.96) (+ x (* z a)) (- x a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9e+37) {
tmp = x - a;
} else if (z <= -1800000000.0) {
tmp = a * (y / z);
} else if (z <= -1.35e-24) {
tmp = x;
} else if (z <= 0.96) {
tmp = x + (z * 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 <= (-9d+37)) then
tmp = x - a
else if (z <= (-1800000000.0d0)) then
tmp = a * (y / z)
else if (z <= (-1.35d-24)) then
tmp = x
else if (z <= 0.96d0) then
tmp = x + (z * 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 <= -9e+37) {
tmp = x - a;
} else if (z <= -1800000000.0) {
tmp = a * (y / z);
} else if (z <= -1.35e-24) {
tmp = x;
} else if (z <= 0.96) {
tmp = x + (z * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9e+37: tmp = x - a elif z <= -1800000000.0: tmp = a * (y / z) elif z <= -1.35e-24: tmp = x elif z <= 0.96: tmp = x + (z * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9e+37) tmp = Float64(x - a); elseif (z <= -1800000000.0) tmp = Float64(a * Float64(y / z)); elseif (z <= -1.35e-24) tmp = x; elseif (z <= 0.96) tmp = Float64(x + Float64(z * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9e+37) tmp = x - a; elseif (z <= -1800000000.0) tmp = a * (y / z); elseif (z <= -1.35e-24) tmp = x; elseif (z <= 0.96) tmp = x + (z * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9e+37], N[(x - a), $MachinePrecision], If[LessEqual[z, -1800000000.0], N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.35e-24], x, If[LessEqual[z, 0.96], N[(x + N[(z * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+37}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq -1800000000:\\
\;\;\;\;a \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-24}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 0.96:\\
\;\;\;\;x + z \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8.99999999999999923e37 or 0.95999999999999996 < z Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
if -8.99999999999999923e37 < z < -1.8e9Initial program 99.7%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around inf 79.3%
mul-1-neg79.3%
Simplified79.3%
Taylor expanded in y around inf 79.3%
associate-/l*79.3%
Simplified79.3%
if -1.8e9 < z < -1.35000000000000003e-24Initial program 99.5%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in t around inf 99.5%
Taylor expanded in x around inf 69.4%
if -1.35000000000000003e-24 < z < 0.95999999999999996Initial program 99.6%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in y around 0 59.0%
mul-1-neg59.0%
associate--l+59.0%
+-commutative59.0%
distribute-neg-frac259.0%
+-commutative59.0%
distribute-neg-in59.0%
metadata-eval59.0%
unsub-neg59.0%
associate--r-59.0%
Simplified59.0%
Taylor expanded in z around 0 59.1%
mul-1-neg59.1%
distribute-neg-frac259.1%
distribute-neg-in59.1%
metadata-eval59.1%
sub-neg59.1%
Simplified59.1%
Taylor expanded in t around 0 54.5%
associate-*r*54.5%
neg-mul-154.5%
cancel-sign-sub54.5%
Simplified54.5%
Final simplification67.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+79) (not (<= z 1.55e+72))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+79) || !(z <= 1.55e+72)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.5d+79)) .or. (.not. (z <= 1.55d+72))) then
tmp = x - a
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+79) || !(z <= 1.55e+72)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+79) or not (z <= 1.55e+72): tmp = x - a else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e+79) || !(z <= 1.55e+72)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e+79) || ~((z <= 1.55e+72))) tmp = x - a; else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e+79], N[Not[LessEqual[z, 1.55e+72]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+79} \lor \neg \left(z \leq 1.55 \cdot 10^{+72}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -3.4999999999999998e79 or 1.54999999999999994e72 < z Initial program 96.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.7%
if -3.4999999999999998e79 < z < 1.54999999999999994e72Initial program 99.6%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around 0 89.4%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+16) (not (<= z 2.6e+68))) (+ x (* (- y z) (/ a z))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+16) || !(z <= 2.6e+68)) {
tmp = x + ((y - z) * (a / z));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.2d+16)) .or. (.not. (z <= 2.6d+68))) then
tmp = x + ((y - z) * (a / z))
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+16) || !(z <= 2.6e+68)) {
tmp = x + ((y - z) * (a / z));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+16) or not (z <= 2.6e+68): tmp = x + ((y - z) * (a / z)) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+16) || !(z <= 2.6e+68)) tmp = Float64(x + Float64(Float64(y - z) * Float64(a / z))); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.2e+16) || ~((z <= 2.6e+68))) tmp = x + ((y - z) * (a / z)); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+16], N[Not[LessEqual[z, 2.6e+68]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+16} \lor \neg \left(z \leq 2.6 \cdot 10^{+68}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{a}{z}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -3.2e16 or 2.5999999999999998e68 < z Initial program 96.8%
clear-num96.8%
associate-/r/96.7%
clear-num96.8%
Applied egg-rr96.8%
Taylor expanded in z around inf 87.9%
associate-*r/87.9%
neg-mul-187.9%
Simplified87.9%
if -3.2e16 < z < 2.5999999999999998e68Initial program 99.6%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around 0 89.9%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+78) (not (<= z 2.6e+68))) (+ x (* a (/ (- y z) z))) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+78) || !(z <= 2.6e+68)) {
tmp = x + (a * ((y - z) / z));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.2d+78)) .or. (.not. (z <= 2.6d+68))) then
tmp = x + (a * ((y - z) / z))
else
tmp = x + (a * (y / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+78) || !(z <= 2.6e+68)) {
tmp = x + (a * ((y - z) / z));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+78) or not (z <= 2.6e+68): tmp = x + (a * ((y - z) / z)) else: tmp = x + (a * (y / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+78) || !(z <= 2.6e+68)) tmp = Float64(x + Float64(a * Float64(Float64(y - z) / z))); else tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+78) || ~((z <= 2.6e+68))) tmp = x + (a * ((y - z) / z)); else tmp = x + (a * (y / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+78], N[Not[LessEqual[z, 2.6e+68]], $MachinePrecision]], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+78} \lor \neg \left(z \leq 2.6 \cdot 10^{+68}\right):\\
\;\;\;\;x + a \cdot \frac{y - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -5.2e78 or 2.5999999999999998e68 < z Initial program 96.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 91.1%
mul-1-neg91.1%
Simplified91.1%
if -5.2e78 < z < 2.5999999999999998e68Initial program 99.6%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in z around 0 89.4%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+68) (not (<= z 2.6e+68))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+68) || !(z <= 2.6e+68)) {
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 <= (-2.6d+68)) .or. (.not. (z <= 2.6d+68))) 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 <= -2.6e+68) || !(z <= 2.6e+68)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+68) or not (z <= 2.6e+68): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+68) || !(z <= 2.6e+68)) 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 <= -2.6e+68) || ~((z <= 2.6e+68))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+68], N[Not[LessEqual[z, 2.6e+68]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+68} \lor \neg \left(z \leq 2.6 \cdot 10^{+68}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -2.5999999999999998e68 or 2.5999999999999998e68 < z Initial program 96.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.3%
if -2.5999999999999998e68 < z < 2.5999999999999998e68Initial program 99.6%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in t around 0 77.7%
Taylor expanded in z around 0 72.0%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ a (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (a / (-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 + ((y - z) * (a / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (a / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + ((y - z) * (a / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(a / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (a / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{a}{-1 + \left(z - t\right)}
\end{array}
Initial program 98.3%
clear-num98.3%
associate-/r/98.3%
clear-num98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (- x a))
double code(double x, double y, double z, double t, double a) {
return x - 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 - a
end function
public static double code(double x, double y, double z, double t, double a) {
return x - a;
}
def code(x, y, z, t, a): return x - a
function code(x, y, z, t, a) return Float64(x - a) end
function tmp = code(x, y, z, t, a) tmp = x - a; end
code[x_, y_, z_, t_, a_] := N[(x - a), $MachinePrecision]
\begin{array}{l}
\\
x - a
\end{array}
Initial program 98.3%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around inf 59.4%
Final simplification59.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 98.3%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in t around inf 50.2%
Taylor expanded in x around inf 53.1%
Final simplification53.1%
(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 2024078
(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))))