
(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 13 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 (/ (+ (- t z) 1.0) (- z y)))))
double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
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 / (((t - z) + 1.0d0) / (z - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
def code(x, y, z, t, a): return x + (a / (((t - z) + 1.0) / (z - y)))
function code(x, y, z, t, a) return Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / Float64(z - y)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a / (((t - z) + 1.0) / (z - y))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\frac{\left(t - z\right) + 1}{z - y}}
\end{array}
Initial program 97.1%
associate-/r/99.5%
Simplified99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.0)
(- x (* a (/ y t)))
(if (<= t 2.5e-181)
(- x (* a y))
(if (<= t 5.8e-13) (* x (- 1.0 (/ a x))) (- x (/ y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.0) {
tmp = x - (a * (y / t));
} else if (t <= 2.5e-181) {
tmp = x - (a * y);
} else if (t <= 5.8e-13) {
tmp = x * (1.0 - (a / x));
} else {
tmp = x - (y / (t / 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 (t <= (-1.0d0)) then
tmp = x - (a * (y / t))
else if (t <= 2.5d-181) then
tmp = x - (a * y)
else if (t <= 5.8d-13) then
tmp = x * (1.0d0 - (a / x))
else
tmp = x - (y / (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.0) {
tmp = x - (a * (y / t));
} else if (t <= 2.5e-181) {
tmp = x - (a * y);
} else if (t <= 5.8e-13) {
tmp = x * (1.0 - (a / x));
} else {
tmp = x - (y / (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.0: tmp = x - (a * (y / t)) elif t <= 2.5e-181: tmp = x - (a * y) elif t <= 5.8e-13: tmp = x * (1.0 - (a / x)) else: tmp = x - (y / (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.0) tmp = Float64(x - Float64(a * Float64(y / t))); elseif (t <= 2.5e-181) tmp = Float64(x - Float64(a * y)); elseif (t <= 5.8e-13) tmp = Float64(x * Float64(1.0 - Float64(a / x))); else tmp = Float64(x - Float64(y / Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.0) tmp = x - (a * (y / t)); elseif (t <= 2.5e-181) tmp = x - (a * y); elseif (t <= 5.8e-13) tmp = x * (1.0 - (a / x)); else tmp = x - (y / (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.0], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-181], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-13], N[(x * N[(1.0 - N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-181}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \left(1 - \frac{a}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{a}}\\
\end{array}
\end{array}
if t < -1Initial program 96.2%
associate-/r/98.5%
Simplified98.5%
Taylor expanded in t around inf 80.9%
Taylor expanded in y around inf 73.7%
associate-/l*77.8%
Simplified77.8%
if -1 < t < 2.5000000000000001e-181Initial program 97.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around 0 71.7%
if 2.5000000000000001e-181 < t < 5.7999999999999995e-13Initial program 97.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 76.0%
Taylor expanded in x around inf 78.3%
mul-1-neg78.3%
unsub-neg78.3%
Simplified78.3%
if 5.7999999999999995e-13 < t Initial program 97.5%
Taylor expanded in t around inf 85.7%
Taylor expanded in y around inf 85.6%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))))
(if (<= t -0.96)
t_1
(if (<= t 2.2e-181)
(- x (* a y))
(if (<= t 0.0014) (* x (- 1.0 (/ a x))) 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 <= -0.96) {
tmp = t_1;
} else if (t <= 2.2e-181) {
tmp = x - (a * y);
} else if (t <= 0.0014) {
tmp = x * (1.0 - (a / x));
} 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 <= (-0.96d0)) then
tmp = t_1
else if (t <= 2.2d-181) then
tmp = x - (a * y)
else if (t <= 0.0014d0) then
tmp = x * (1.0d0 - (a / x))
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 <= -0.96) {
tmp = t_1;
} else if (t <= 2.2e-181) {
tmp = x - (a * y);
} else if (t <= 0.0014) {
tmp = x * (1.0 - (a / x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if t <= -0.96: tmp = t_1 elif t <= 2.2e-181: tmp = x - (a * y) elif t <= 0.0014: tmp = x * (1.0 - (a / x)) 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 <= -0.96) tmp = t_1; elseif (t <= 2.2e-181) tmp = Float64(x - Float64(a * y)); elseif (t <= 0.0014) tmp = Float64(x * Float64(1.0 - Float64(a / x))); 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 <= -0.96) tmp = t_1; elseif (t <= 2.2e-181) tmp = x - (a * y); elseif (t <= 0.0014) tmp = x * (1.0 - (a / x)); 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, -0.96], t$95$1, If[LessEqual[t, 2.2e-181], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0014], N[(x * N[(1.0 - N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -0.96:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-181}:\\
\;\;\;\;x - a \cdot y\\
\mathbf{elif}\;t \leq 0.0014:\\
\;\;\;\;x \cdot \left(1 - \frac{a}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -0.95999999999999996 or 0.00139999999999999999 < t Initial program 96.8%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in t around inf 78.7%
Taylor expanded in y around inf 75.5%
associate-/l*81.6%
Simplified81.6%
if -0.95999999999999996 < t < 2.19999999999999997e-181Initial program 97.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 99.9%
Taylor expanded in z around 0 71.7%
if 2.19999999999999997e-181 < t < 0.00139999999999999999Initial program 97.5%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 76.0%
Taylor expanded in x around inf 78.3%
mul-1-neg78.3%
unsub-neg78.3%
Simplified78.3%
Final simplification78.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -20.0) (not (<= t 3.2e+115))) (- x (/ (- y z) (/ t a))) (+ x (* a (/ (- y z) (+ z -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -20.0) || !(t <= 3.2e+115)) {
tmp = x - ((y - z) / (t / a));
} else {
tmp = x + (a * ((y - z) / (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 <= (-20.0d0)) .or. (.not. (t <= 3.2d+115))) then
tmp = x - ((y - z) / (t / a))
else
tmp = x + (a * ((y - z) / (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 <= -20.0) || !(t <= 3.2e+115)) {
tmp = x - ((y - z) / (t / a));
} else {
tmp = x + (a * ((y - z) / (z + -1.0)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -20.0) or not (t <= 3.2e+115): tmp = x - ((y - z) / (t / a)) else: tmp = x + (a * ((y - z) / (z + -1.0))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -20.0) || !(t <= 3.2e+115)) tmp = Float64(x - Float64(Float64(y - z) / Float64(t / a))); else tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(z + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -20.0) || ~((t <= 3.2e+115))) tmp = x - ((y - z) / (t / a)); else tmp = x + (a * ((y - z) / (z + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -20.0], N[Not[LessEqual[t, 3.2e+115]], $MachinePrecision]], N[(x - N[(N[(y - z), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -20 \lor \neg \left(t \leq 3.2 \cdot 10^{+115}\right):\\
\;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z + -1}\\
\end{array}
\end{array}
if t < -20 or 3.2e115 < t Initial program 97.0%
Taylor expanded in t around inf 87.3%
if -20 < t < 3.2e115Initial program 97.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 97.4%
Final simplification92.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.05)
(- x (/ (- y z) (/ (+ t 1.0) a)))
(if (<= t 7.2e+109)
(+ x (* a (/ (- y z) (+ z -1.0))))
(- x (/ (- y z) (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.05) {
tmp = x - ((y - z) / ((t + 1.0) / a));
} else if (t <= 7.2e+109) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = x - ((y - z) / (t / 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 (t <= (-1.05d0)) then
tmp = x - ((y - z) / ((t + 1.0d0) / a))
else if (t <= 7.2d+109) then
tmp = x + (a * ((y - z) / (z + (-1.0d0))))
else
tmp = x - ((y - z) / (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.05) {
tmp = x - ((y - z) / ((t + 1.0) / a));
} else if (t <= 7.2e+109) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = x - ((y - z) / (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.05: tmp = x - ((y - z) / ((t + 1.0) / a)) elif t <= 7.2e+109: tmp = x + (a * ((y - z) / (z + -1.0))) else: tmp = x - ((y - z) / (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.05) tmp = Float64(x - Float64(Float64(y - z) / Float64(Float64(t + 1.0) / a))); elseif (t <= 7.2e+109) tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(z + -1.0)))); else tmp = Float64(x - Float64(Float64(y - z) / Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.05) tmp = x - ((y - z) / ((t + 1.0) / a)); elseif (t <= 7.2e+109) tmp = x + (a * ((y - z) / (z + -1.0))); else tmp = x - ((y - z) / (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.05], N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(t + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+109], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - z), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05:\\
\;\;\;\;x - \frac{y - z}{\frac{t + 1}{a}}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+109}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\
\end{array}
\end{array}
if t < -1.05000000000000004Initial program 96.2%
Taylor expanded in z around 0 85.6%
if -1.05000000000000004 < t < 7.2e109Initial program 97.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 97.4%
if 7.2e109 < t Initial program 98.3%
Taylor expanded in t around inf 92.6%
Final simplification93.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+48) (not (<= z 0.0016))) (+ x (/ (- y z) (/ z 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+48) || !(z <= 0.0016)) {
tmp = x + ((y - z) / (z / 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+48)) .or. (.not. (z <= 0.0016d0))) then
tmp = x + ((y - z) / (z / 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+48) || !(z <= 0.0016)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+48) or not (z <= 0.0016): tmp = x + ((y - z) / (z / 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+48) || !(z <= 0.0016)) tmp = Float64(x + Float64(Float64(y - z) / Float64(z / 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+48) || ~((z <= 0.0016))) tmp = x + ((y - z) / (z / 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+48], N[Not[LessEqual[z, 0.0016]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $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.5 \cdot 10^{+48} \lor \neg \left(z \leq 0.0016\right):\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -3.4999999999999997e48 or 0.00160000000000000008 < z Initial program 95.2%
Taylor expanded in z around inf 84.7%
associate-*r/84.7%
neg-mul-184.7%
Simplified84.7%
if -3.4999999999999997e48 < z < 0.00160000000000000008Initial program 98.6%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 90.7%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e+48) (not (<= z 1.12e+18))) (- x a) (+ x (* a (/ y (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+48) || !(z <= 1.12e+18)) {
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 <= (-2.4d+48)) .or. (.not. (z <= 1.12d+18))) 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 <= -2.4e+48) || !(z <= 1.12e+18)) {
tmp = x - a;
} else {
tmp = x + (a * (y / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e+48) or not (z <= 1.12e+18): 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 <= -2.4e+48) || !(z <= 1.12e+18)) 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 <= -2.4e+48) || ~((z <= 1.12e+18))) 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, -2.4e+48], N[Not[LessEqual[z, 1.12e+18]], $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 -2.4 \cdot 10^{+48} \lor \neg \left(z \leq 1.12 \cdot 10^{+18}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\end{array}
\end{array}
if z < -2.4000000000000001e48 or 1.12e18 < z Initial program 95.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 79.3%
if -2.4000000000000001e48 < z < 1.12e18Initial program 98.7%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around 0 90.4%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1e+41) (+ x (* a (/ z (+ (- t z) 1.0)))) (if (<= z 0.0016) (+ x (* a (/ y (- -1.0 t)))) (+ x (/ (- y z) (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+41) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else if (z <= 0.0016) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (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 <= (-1d+41)) then
tmp = x + (a * (z / ((t - z) + 1.0d0)))
else if (z <= 0.0016d0) then
tmp = x + (a * (y / ((-1.0d0) - t)))
else
tmp = x + ((y - z) / (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 <= -1e+41) {
tmp = x + (a * (z / ((t - z) + 1.0)));
} else if (z <= 0.0016) {
tmp = x + (a * (y / (-1.0 - t)));
} else {
tmp = x + ((y - z) / (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e+41: tmp = x + (a * (z / ((t - z) + 1.0))) elif z <= 0.0016: tmp = x + (a * (y / (-1.0 - t))) else: tmp = x + ((y - z) / (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+41) tmp = Float64(x + Float64(a * Float64(z / Float64(Float64(t - z) + 1.0)))); elseif (z <= 0.0016) tmp = Float64(x + Float64(a * Float64(y / Float64(-1.0 - t)))); else tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1e+41) tmp = x + (a * (z / ((t - z) + 1.0))); elseif (z <= 0.0016) tmp = x + (a * (y / (-1.0 - t))); else tmp = x + ((y - z) / (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+41], N[(x + N[(a * N[(z / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0016], N[(x + N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+41}:\\
\;\;\;\;x + a \cdot \frac{z}{\left(t - z\right) + 1}\\
\mathbf{elif}\;z \leq 0.0016:\\
\;\;\;\;x + a \cdot \frac{y}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\end{array}
\end{array}
if z < -1.00000000000000001e41Initial program 89.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 88.7%
associate--l+88.7%
+-commutative88.7%
neg-mul-188.7%
distribute-neg-frac288.7%
+-commutative88.7%
distribute-neg-in88.7%
metadata-eval88.7%
unsub-neg88.7%
Simplified88.7%
if -1.00000000000000001e41 < z < 0.00160000000000000008Initial program 99.1%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 91.2%
if 0.00160000000000000008 < z Initial program 97.4%
Taylor expanded in z around inf 87.3%
associate-*r/87.3%
neg-mul-187.3%
Simplified87.3%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+47) (not (<= z 7.4e-20))) (- x a) (- x (* a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+47) || !(z <= 7.4e-20)) {
tmp = x - a;
} else {
tmp = x - (a * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.1d+47)) .or. (.not. (z <= 7.4d-20))) then
tmp = x - a
else
tmp = x - (a * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+47) || !(z <= 7.4e-20)) {
tmp = x - a;
} else {
tmp = x - (a * y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+47) or not (z <= 7.4e-20): tmp = x - a else: tmp = x - (a * y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+47) || !(z <= 7.4e-20)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e+47) || ~((z <= 7.4e-20))) tmp = x - a; else tmp = x - (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+47], N[Not[LessEqual[z, 7.4e-20]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+47} \lor \neg \left(z \leq 7.4 \cdot 10^{-20}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot y\\
\end{array}
\end{array}
if z < -1.1e47 or 7.4000000000000001e-20 < z Initial program 95.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.2%
if -1.1e47 < z < 7.4000000000000001e-20Initial program 98.6%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in t around 0 73.2%
Taylor expanded in z around 0 69.2%
Final simplification73.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e+50) (not (<= z 13000000000.0))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e+50) || !(z <= 13000000000.0)) {
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 <= (-9.5d+50)) .or. (.not. (z <= 13000000000.0d0))) 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 <= -9.5e+50) || !(z <= 13000000000.0)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e+50) or not (z <= 13000000000.0): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e+50) || !(z <= 13000000000.0)) 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 <= -9.5e+50) || ~((z <= 13000000000.0))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e+50], N[Not[LessEqual[z, 13000000000.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+50} \lor \neg \left(z \leq 13000000000\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.4999999999999993e50 or 1.3e10 < z Initial program 95.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.6%
if -9.4999999999999993e50 < z < 1.3e10Initial program 98.7%
associate-/r/99.3%
Simplified99.3%
Taylor expanded in z around inf 44.9%
Taylor expanded in x around inf 54.8%
Final simplification65.1%
(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.1%
associate-/r/99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (<= a 8.6e+189) x (- a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 8.6e+189) {
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 <= 8.6d+189) 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 <= 8.6e+189) {
tmp = x;
} else {
tmp = -a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 8.6e+189: tmp = x else: tmp = -a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 8.6e+189) tmp = x; else tmp = Float64(-a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 8.6e+189) tmp = x; else tmp = -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 8.6e+189], x, (-a)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.6 \cdot 10^{+189}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-a\\
\end{array}
\end{array}
if a < 8.59999999999999995e189Initial program 96.8%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 62.9%
Taylor expanded in x around inf 61.2%
if 8.59999999999999995e189 < a Initial program 99.8%
associate-/r/96.2%
Simplified96.2%
Taylor expanded in z around inf 29.7%
Taylor expanded in x around 0 24.1%
mul-1-neg24.1%
Simplified24.1%
(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.1%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in z around inf 59.5%
Taylor expanded in x around inf 55.6%
(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 2024139
(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))))