
(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 10 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 (/ (- z y) (+ (- t z) 1.0)))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.0)));
}
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 * ((z - y) / ((t - z) + 1.0d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((z - y) / ((t - z) + 1.0)));
}
def code(x, y, z, t, a): return x + (a * ((z - y) / ((t - z) + 1.0)))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((z - y) / ((t - z) + 1.0))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{z - y}{\left(t - z\right) + 1}
\end{array}
Initial program 99.1%
associate-/r/99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ a (+ (/ 1.0 z) -1.0)))) (t_2 (- x (/ a (/ t y)))))
(if (<= t -5.1e+33)
t_2
(if (<= t 7e-209)
t_1
(if (<= t 5.6e-71) (- x (* y a)) (if (<= t 4.4e+57) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a / ((1.0 / z) + -1.0));
double t_2 = x - (a / (t / y));
double tmp;
if (t <= -5.1e+33) {
tmp = t_2;
} else if (t <= 7e-209) {
tmp = t_1;
} else if (t <= 5.6e-71) {
tmp = x - (y * a);
} else if (t <= 4.4e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (a / ((1.0d0 / z) + (-1.0d0)))
t_2 = x - (a / (t / y))
if (t <= (-5.1d+33)) then
tmp = t_2
else if (t <= 7d-209) then
tmp = t_1
else if (t <= 5.6d-71) then
tmp = x - (y * a)
else if (t <= 4.4d+57) then
tmp = t_1
else
tmp = t_2
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 / ((1.0 / z) + -1.0));
double t_2 = x - (a / (t / y));
double tmp;
if (t <= -5.1e+33) {
tmp = t_2;
} else if (t <= 7e-209) {
tmp = t_1;
} else if (t <= 5.6e-71) {
tmp = x - (y * a);
} else if (t <= 4.4e+57) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a / ((1.0 / z) + -1.0)) t_2 = x - (a / (t / y)) tmp = 0 if t <= -5.1e+33: tmp = t_2 elif t <= 7e-209: tmp = t_1 elif t <= 5.6e-71: tmp = x - (y * a) elif t <= 4.4e+57: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a / Float64(Float64(1.0 / z) + -1.0))) t_2 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (t <= -5.1e+33) tmp = t_2; elseif (t <= 7e-209) tmp = t_1; elseif (t <= 5.6e-71) tmp = Float64(x - Float64(y * a)); elseif (t <= 4.4e+57) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a / ((1.0 / z) + -1.0)); t_2 = x - (a / (t / y)); tmp = 0.0; if (t <= -5.1e+33) tmp = t_2; elseif (t <= 7e-209) tmp = t_1; elseif (t <= 5.6e-71) tmp = x - (y * a); elseif (t <= 4.4e+57) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a / N[(N[(1.0 / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.1e+33], t$95$2, If[LessEqual[t, 7e-209], t$95$1, If[LessEqual[t, 5.6e-71], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+57], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{a}{\frac{1}{z} + -1}\\
t_2 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -5.1 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-209}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-71}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+57}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -5.0999999999999999e33 or 4.4000000000000001e57 < t Initial program 99.9%
Taylor expanded in t around inf 94.6%
Taylor expanded in z around 0 81.6%
associate-/l*88.9%
Simplified88.9%
if -5.0999999999999999e33 < t < 7.00000000000000004e-209 or 5.60000000000000001e-71 < t < 4.4000000000000001e57Initial program 98.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 83.6%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in y around 0 69.5%
sub-neg69.5%
mul-1-neg69.5%
remove-double-neg69.5%
associate-/l*81.7%
div-sub81.7%
sub-neg81.7%
*-inverses81.7%
metadata-eval81.7%
Simplified81.7%
if 7.00000000000000004e-209 < t < 5.60000000000000001e-71Initial program 99.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 77.5%
associate-/l*77.4%
Simplified77.4%
Taylor expanded in t around 0 77.5%
Final simplification84.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ a (+ (/ 1.0 z) -1.0)))) (t_2 (+ x (* a (/ (- z y) t)))))
(if (<= t -1.55e+34)
t_2
(if (<= t 4.4e-206)
t_1
(if (<= t 4.4e-71) (- x (* y a)) (if (<= t 2e+59) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a / ((1.0 / z) + -1.0));
double t_2 = x + (a * ((z - y) / t));
double tmp;
if (t <= -1.55e+34) {
tmp = t_2;
} else if (t <= 4.4e-206) {
tmp = t_1;
} else if (t <= 4.4e-71) {
tmp = x - (y * a);
} else if (t <= 2e+59) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + (a / ((1.0d0 / z) + (-1.0d0)))
t_2 = x + (a * ((z - y) / t))
if (t <= (-1.55d+34)) then
tmp = t_2
else if (t <= 4.4d-206) then
tmp = t_1
else if (t <= 4.4d-71) then
tmp = x - (y * a)
else if (t <= 2d+59) then
tmp = t_1
else
tmp = t_2
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 / ((1.0 / z) + -1.0));
double t_2 = x + (a * ((z - y) / t));
double tmp;
if (t <= -1.55e+34) {
tmp = t_2;
} else if (t <= 4.4e-206) {
tmp = t_1;
} else if (t <= 4.4e-71) {
tmp = x - (y * a);
} else if (t <= 2e+59) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a / ((1.0 / z) + -1.0)) t_2 = x + (a * ((z - y) / t)) tmp = 0 if t <= -1.55e+34: tmp = t_2 elif t <= 4.4e-206: tmp = t_1 elif t <= 4.4e-71: tmp = x - (y * a) elif t <= 2e+59: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a / Float64(Float64(1.0 / z) + -1.0))) t_2 = Float64(x + Float64(a * Float64(Float64(z - y) / t))) tmp = 0.0 if (t <= -1.55e+34) tmp = t_2; elseif (t <= 4.4e-206) tmp = t_1; elseif (t <= 4.4e-71) tmp = Float64(x - Float64(y * a)); elseif (t <= 2e+59) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a / ((1.0 / z) + -1.0)); t_2 = x + (a * ((z - y) / t)); tmp = 0.0; if (t <= -1.55e+34) tmp = t_2; elseif (t <= 4.4e-206) tmp = t_1; elseif (t <= 4.4e-71) tmp = x - (y * a); elseif (t <= 2e+59) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a / N[(N[(1.0 / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e+34], t$95$2, If[LessEqual[t, 4.4e-206], t$95$1, If[LessEqual[t, 4.4e-71], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+59], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{a}{\frac{1}{z} + -1}\\
t_2 := x + a \cdot \frac{z - y}{t}\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-71}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.54999999999999989e34 or 1.99999999999999994e59 < t Initial program 99.9%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in t around inf 95.2%
if -1.54999999999999989e34 < t < 4.3999999999999997e-206 or 4.39999999999999995e-71 < t < 1.99999999999999994e59Initial program 98.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 83.8%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in y around 0 69.8%
sub-neg69.8%
mul-1-neg69.8%
remove-double-neg69.8%
associate-/l*81.8%
div-sub81.8%
sub-neg81.8%
*-inverses81.8%
metadata-eval81.8%
Simplified81.8%
if 4.3999999999999997e-206 < t < 4.39999999999999995e-71Initial program 99.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 77.5%
associate-/l*77.4%
Simplified77.4%
Taylor expanded in t around 0 77.5%
Final simplification87.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ a (/ t y)))))
(if (<= t -1.3e-28)
t_1
(if (<= t 1.15e-208)
(- x a)
(if (<= t 6.5e-71) (- x (* y a)) (if (<= t 9.8e+17) (- x a) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a / (t / y));
double tmp;
if (t <= -1.3e-28) {
tmp = t_1;
} else if (t <= 1.15e-208) {
tmp = x - a;
} else if (t <= 6.5e-71) {
tmp = x - (y * a);
} else if (t <= 9.8e+17) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - (a / (t / y))
if (t <= (-1.3d-28)) then
tmp = t_1
else if (t <= 1.15d-208) then
tmp = x - a
else if (t <= 6.5d-71) then
tmp = x - (y * a)
else if (t <= 9.8d+17) then
tmp = x - a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a / (t / y));
double tmp;
if (t <= -1.3e-28) {
tmp = t_1;
} else if (t <= 1.15e-208) {
tmp = x - a;
} else if (t <= 6.5e-71) {
tmp = x - (y * a);
} else if (t <= 9.8e+17) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a / (t / y)) tmp = 0 if t <= -1.3e-28: tmp = t_1 elif t <= 1.15e-208: tmp = x - a elif t <= 6.5e-71: tmp = x - (y * a) elif t <= 9.8e+17: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (t <= -1.3e-28) tmp = t_1; elseif (t <= 1.15e-208) tmp = Float64(x - a); elseif (t <= 6.5e-71) tmp = Float64(x - Float64(y * a)); elseif (t <= 9.8e+17) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a / (t / y)); tmp = 0.0; if (t <= -1.3e-28) tmp = t_1; elseif (t <= 1.15e-208) tmp = x - a; elseif (t <= 6.5e-71) tmp = x - (y * a); elseif (t <= 9.8e+17) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.3e-28], t$95$1, If[LessEqual[t, 1.15e-208], N[(x - a), $MachinePrecision], If[LessEqual[t, 6.5e-71], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.8e+17], N[(x - a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-208}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-71}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{+17}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.3e-28 or 9.8e17 < t Initial program 99.9%
Taylor expanded in t around inf 91.6%
Taylor expanded in z around 0 80.7%
associate-/l*87.2%
Simplified87.2%
if -1.3e-28 < t < 1.14999999999999998e-208 or 6.50000000000000005e-71 < t < 9.8e17Initial program 97.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 73.7%
if 1.14999999999999998e-208 < t < 6.50000000000000005e-71Initial program 99.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around 0 77.5%
associate-/l*77.4%
Simplified77.4%
Taylor expanded in t around 0 77.5%
Final simplification81.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.05e+34)
(+ x (* a (/ (- z y) t)))
(if (<= t 9e+95)
(- x (/ a (/ (- 1.0 z) (- y z))))
(+ x (/ (- z y) (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.05e+34) {
tmp = x + (a * ((z - y) / t));
} else if (t <= 9e+95) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x + ((z - 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 <= (-2.05d+34)) then
tmp = x + (a * ((z - y) / t))
else if (t <= 9d+95) then
tmp = x - (a / ((1.0d0 - z) / (y - z)))
else
tmp = x + ((z - 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 <= -2.05e+34) {
tmp = x + (a * ((z - y) / t));
} else if (t <= 9e+95) {
tmp = x - (a / ((1.0 - z) / (y - z)));
} else {
tmp = x + ((z - y) / (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.05e+34: tmp = x + (a * ((z - y) / t)) elif t <= 9e+95: tmp = x - (a / ((1.0 - z) / (y - z))) else: tmp = x + ((z - y) / (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.05e+34) tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); elseif (t <= 9e+95) tmp = Float64(x - Float64(a / Float64(Float64(1.0 - z) / Float64(y - z)))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.05e+34) tmp = x + (a * ((z - y) / t)); elseif (t <= 9e+95) tmp = x - (a / ((1.0 - z) / (y - z))); else tmp = x + ((z - y) / (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.05e+34], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+95], N[(x - N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+34}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+95}:\\
\;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\end{array}
\end{array}
if t < -2.0499999999999999e34Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 94.5%
if -2.0499999999999999e34 < t < 9.00000000000000033e95Initial program 98.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 84.3%
associate-/l*96.8%
Simplified96.8%
if 9.00000000000000033e95 < t Initial program 99.9%
Taylor expanded in t around inf 99.9%
Final simplification96.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.35e+132)
(- x a)
(if (<= z 3.55e+68)
(- x (/ a (/ (+ t 1.0) y)))
(+ x (/ (- z y) (/ (- z) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+132) {
tmp = x - a;
} else if (z <= 3.55e+68) {
tmp = x - (a / ((t + 1.0) / y));
} else {
tmp = x + ((z - y) / (-z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.35d+132)) then
tmp = x - a
else if (z <= 3.55d+68) then
tmp = x - (a / ((t + 1.0d0) / y))
else
tmp = x + ((z - y) / (-z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+132) {
tmp = x - a;
} else if (z <= 3.55e+68) {
tmp = x - (a / ((t + 1.0) / y));
} else {
tmp = x + ((z - y) / (-z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e+132: tmp = x - a elif z <= 3.55e+68: tmp = x - (a / ((t + 1.0) / y)) else: tmp = x + ((z - y) / (-z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+132) tmp = Float64(x - a); elseif (z <= 3.55e+68) tmp = Float64(x - Float64(a / Float64(Float64(t + 1.0) / y))); else tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(-z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.35e+132) tmp = x - a; elseif (z <= 3.55e+68) tmp = x - (a / ((t + 1.0) / y)); else tmp = x + ((z - y) / (-z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+132], N[(x - a), $MachinePrecision], If[LessEqual[z, 3.55e+68], N[(x - N[(a / N[(N[(t + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - y), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+132}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 3.55 \cdot 10^{+68}:\\
\;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\
\end{array}
\end{array}
if z < -1.35e132Initial program 96.9%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 93.8%
if -1.35e132 < z < 3.5500000000000001e68Initial program 99.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in z around 0 84.8%
associate-/l*89.4%
Simplified89.4%
if 3.5500000000000001e68 < z Initial program 97.7%
Taylor expanded in z around inf 87.4%
mul-1-neg87.4%
distribute-neg-frac87.4%
Simplified87.4%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.05e+136) (not (<= z 900.0))) (- x a) (- x (/ a (/ (+ t 1.0) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.05e+136) || !(z <= 900.0)) {
tmp = x - a;
} else {
tmp = x - (a / ((t + 1.0) / 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.05d+136)) .or. (.not. (z <= 900.0d0))) then
tmp = x - a
else
tmp = x - (a / ((t + 1.0d0) / 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.05e+136) || !(z <= 900.0)) {
tmp = x - a;
} else {
tmp = x - (a / ((t + 1.0) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.05e+136) or not (z <= 900.0): tmp = x - a else: tmp = x - (a / ((t + 1.0) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.05e+136) || !(z <= 900.0)) tmp = Float64(x - a); else tmp = Float64(x - Float64(a / Float64(Float64(t + 1.0) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.05e+136) || ~((z <= 900.0))) tmp = x - a; else tmp = x - (a / ((t + 1.0) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.05e+136], N[Not[LessEqual[z, 900.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(a / N[(N[(t + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+136} \lor \neg \left(z \leq 900\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\
\end{array}
\end{array}
if z < -1.05e136 or 900 < z Initial program 97.8%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.4%
if -1.05e136 < z < 900Initial program 99.9%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 85.7%
associate-/l*90.7%
Simplified90.7%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e+54) (not (<= z 1.25))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e+54) || !(z <= 1.25)) {
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 <= (-7.5d+54)) .or. (.not. (z <= 1.25d0))) 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 <= -7.5e+54) || !(z <= 1.25)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e+54) or not (z <= 1.25): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e+54) || !(z <= 1.25)) 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 <= -7.5e+54) || ~((z <= 1.25))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e+54], N[Not[LessEqual[z, 1.25]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+54} \lor \neg \left(z \leq 1.25\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -7.50000000000000042e54 or 1.25 < z Initial program 98.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.0%
if -7.50000000000000042e54 < z < 1.25Initial program 99.9%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 87.2%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in t around 0 69.2%
Final simplification75.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.6e+53) (not (<= z 880.0))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.6e+53) || !(z <= 880.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 <= (-5.6d+53)) .or. (.not. (z <= 880.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 <= -5.6e+53) || !(z <= 880.0)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.6e+53) or not (z <= 880.0): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.6e+53) || !(z <= 880.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 <= -5.6e+53) || ~((z <= 880.0))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.6e+53], N[Not[LessEqual[z, 880.0]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+53} \lor \neg \left(z \leq 880\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.6e53 or 880 < z Initial program 98.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in z around inf 85.0%
if -5.6e53 < z < 880Initial program 99.9%
Taylor expanded in t around inf 70.8%
Taylor expanded in x around inf 59.2%
Final simplification69.5%
(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 99.1%
Taylor expanded in t around inf 60.1%
Taylor expanded in x around inf 57.6%
Final simplification57.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 2023322
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:herbie-target
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))