
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - 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 a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a)))) (if (<= t_1 5e+88) (+ x (* t_1 y)) (+ x (* (- z t) (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 5e+88) {
tmp = x + (t_1 * y);
} else {
tmp = x + ((z - t) * (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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= 5d+88) then
tmp = x + (t_1 * y)
else
tmp = x + ((z - t) * (y / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 5e+88) {
tmp = x + (t_1 * y);
} else {
tmp = x + ((z - t) * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= 5e+88: tmp = x + (t_1 * y) else: tmp = x + ((z - t) * (y / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 5e+88) tmp = Float64(x + Float64(t_1 * y)); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= 5e+88) tmp = x + (t_1 * y); else tmp = x + ((z - t) * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+88], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+88}:\\
\;\;\;\;x + t_1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999997e88Initial program 99.1%
if 4.99999999999999997e88 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 86.5%
Taylor expanded in y around 0 99.9%
associate-*l/99.9%
Simplified99.9%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -2.7e-87)
t_1
(if (<= z 4.1e-123)
(+ x (* t (/ y a)))
(if (or (<= z 9e-49) (not (<= z 1e+113)))
(+ x (* y (- 1.0 (/ t z))))
t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -2.7e-87) {
tmp = t_1;
} else if (z <= 4.1e-123) {
tmp = x + (t * (y / a));
} else if ((z <= 9e-49) || !(z <= 1e+113)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * (z / (z - a)))
if (z <= (-2.7d-87)) then
tmp = t_1
else if (z <= 4.1d-123) then
tmp = x + (t * (y / a))
else if ((z <= 9d-49) .or. (.not. (z <= 1d+113))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -2.7e-87) {
tmp = t_1;
} else if (z <= 4.1e-123) {
tmp = x + (t * (y / a));
} else if ((z <= 9e-49) || !(z <= 1e+113)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -2.7e-87: tmp = t_1 elif z <= 4.1e-123: tmp = x + (t * (y / a)) elif (z <= 9e-49) or not (z <= 1e+113): tmp = x + (y * (1.0 - (t / z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -2.7e-87) tmp = t_1; elseif (z <= 4.1e-123) tmp = Float64(x + Float64(t * Float64(y / a))); elseif ((z <= 9e-49) || !(z <= 1e+113)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -2.7e-87) tmp = t_1; elseif (z <= 4.1e-123) tmp = x + (t * (y / a)); elseif ((z <= 9e-49) || ~((z <= 1e+113))) tmp = x + (y * (1.0 - (t / z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e-87], t$95$1, If[LessEqual[z, 4.1e-123], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 9e-49], N[Not[LessEqual[z, 1e+113]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{-87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-123}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-49} \lor \neg \left(z \leq 10^{+113}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.69999999999999984e-87 or 9.0000000000000004e-49 < z < 1e113Initial program 98.4%
Taylor expanded in t around 0 83.7%
if -2.69999999999999984e-87 < z < 4.1e-123Initial program 95.2%
Taylor expanded in z around 0 89.0%
associate-/l*90.1%
Simplified90.1%
associate-/r/90.5%
Applied egg-rr90.5%
if 4.1e-123 < z < 9.0000000000000004e-49 or 1e113 < z Initial program 98.4%
Taylor expanded in a around 0 93.8%
div-sub93.8%
*-inverses93.8%
Simplified93.8%
Final simplification88.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.8e-87)
(+ x (* y (/ z (- z a))))
(if (<= z 2e-124)
(+ x (* t (/ y a)))
(if (or (<= z 2.05e-68) (not (<= z 1.04e+111)))
(+ x (* y (- 1.0 (/ t z))))
(+ x (* z (/ y (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e-87) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 2e-124) {
tmp = x + (t * (y / a));
} else if ((z <= 2.05e-68) || !(z <= 1.04e+111)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-2.8d-87)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 2d-124) then
tmp = x + (t * (y / a))
else if ((z <= 2.05d-68) .or. (.not. (z <= 1.04d+111))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -2.8e-87) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 2e-124) {
tmp = x + (t * (y / a));
} else if ((z <= 2.05e-68) || !(z <= 1.04e+111)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.8e-87: tmp = x + (y * (z / (z - a))) elif z <= 2e-124: tmp = x + (t * (y / a)) elif (z <= 2.05e-68) or not (z <= 1.04e+111): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e-87) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 2e-124) tmp = Float64(x + Float64(t * Float64(y / a))); elseif ((z <= 2.05e-68) || !(z <= 1.04e+111)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.8e-87) tmp = x + (y * (z / (z - a))); elseif (z <= 2e-124) tmp = x + (t * (y / a)); elseif ((z <= 2.05e-68) || ~((z <= 1.04e+111))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e-87], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-124], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.05e-68], N[Not[LessEqual[z, 1.04e+111]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-87}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-124}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-68} \lor \neg \left(z \leq 1.04 \cdot 10^{+111}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -2.8000000000000001e-87Initial program 98.8%
Taylor expanded in t around 0 84.2%
if -2.8000000000000001e-87 < z < 1.99999999999999987e-124Initial program 95.2%
Taylor expanded in z around 0 89.0%
associate-/l*90.1%
Simplified90.1%
associate-/r/90.5%
Applied egg-rr90.5%
if 1.99999999999999987e-124 < z < 2.05000000000000011e-68 or 1.04e111 < z Initial program 98.3%
Taylor expanded in a around 0 93.4%
div-sub93.4%
*-inverses93.4%
Simplified93.4%
if 2.05000000000000011e-68 < z < 1.04e111Initial program 97.6%
Taylor expanded in t around 0 76.7%
associate-*l/84.4%
*-commutative84.4%
Simplified84.4%
Final simplification88.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.7e+46)
(+ x y)
(if (<= z 3.95e-128)
(+ x (* y (/ t a)))
(if (<= z 2.9e+133) (- x (* t (/ y z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+46) {
tmp = x + y;
} else if (z <= 3.95e-128) {
tmp = x + (y * (t / a));
} else if (z <= 2.9e+133) {
tmp = x - (t * (y / z));
} else {
tmp = x + 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.7d+46)) then
tmp = x + y
else if (z <= 3.95d-128) then
tmp = x + (y * (t / a))
else if (z <= 2.9d+133) then
tmp = x - (t * (y / z))
else
tmp = x + 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.7e+46) {
tmp = x + y;
} else if (z <= 3.95e-128) {
tmp = x + (y * (t / a));
} else if (z <= 2.9e+133) {
tmp = x - (t * (y / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.7e+46: tmp = x + y elif z <= 3.95e-128: tmp = x + (y * (t / a)) elif z <= 2.9e+133: tmp = x - (t * (y / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+46) tmp = Float64(x + y); elseif (z <= 3.95e-128) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 2.9e+133) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.7e+46) tmp = x + y; elseif (z <= 3.95e-128) tmp = x + (y * (t / a)); elseif (z <= 2.9e+133) tmp = x - (t * (y / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+46], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.95e-128], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+133], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+46}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.95 \cdot 10^{-128}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+133}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.6999999999999999e46 or 2.9000000000000001e133 < z Initial program 100.0%
Taylor expanded in z around inf 85.4%
if -1.6999999999999999e46 < z < 3.9500000000000001e-128Initial program 95.5%
Taylor expanded in z around 0 83.3%
if 3.9500000000000001e-128 < z < 2.9000000000000001e133Initial program 97.1%
Taylor expanded in a around 0 75.3%
div-sub75.3%
*-inverses75.3%
Simplified75.3%
Taylor expanded in t around inf 74.9%
associate-*r/74.9%
mul-1-neg74.9%
distribute-rgt-neg-in74.9%
associate-/l*72.1%
Simplified72.1%
Taylor expanded in x around 0 74.9%
+-commutative74.9%
mul-1-neg74.9%
associate-*r/70.5%
sub-neg70.5%
Simplified70.5%
Taylor expanded in x around 0 74.9%
neg-mul-174.9%
+-commutative74.9%
sub-neg74.9%
*-commutative74.9%
associate-*r/74.6%
Simplified74.6%
Final simplification81.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.75e+44)
(+ x y)
(if (<= z 3.9e-128)
(+ x (* y (/ t a)))
(if (<= z 3.8e+134) (- x (/ t (/ z y))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e+44) {
tmp = x + y;
} else if (z <= 3.9e-128) {
tmp = x + (y * (t / a));
} else if (z <= 3.8e+134) {
tmp = x - (t / (z / y));
} else {
tmp = x + 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.75d+44)) then
tmp = x + y
else if (z <= 3.9d-128) then
tmp = x + (y * (t / a))
else if (z <= 3.8d+134) then
tmp = x - (t / (z / y))
else
tmp = x + 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.75e+44) {
tmp = x + y;
} else if (z <= 3.9e-128) {
tmp = x + (y * (t / a));
} else if (z <= 3.8e+134) {
tmp = x - (t / (z / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.75e+44: tmp = x + y elif z <= 3.9e-128: tmp = x + (y * (t / a)) elif z <= 3.8e+134: tmp = x - (t / (z / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e+44) tmp = Float64(x + y); elseif (z <= 3.9e-128) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 3.8e+134) tmp = Float64(x - Float64(t / Float64(z / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.75e+44) tmp = x + y; elseif (z <= 3.9e-128) tmp = x + (y * (t / a)); elseif (z <= 3.8e+134) tmp = x - (t / (z / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e+44], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.9e-128], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+134], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+44}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-128}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+134}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.75e44 or 3.79999999999999998e134 < z Initial program 100.0%
Taylor expanded in z around inf 85.4%
if -1.75e44 < z < 3.89999999999999997e-128Initial program 95.5%
Taylor expanded in z around 0 83.3%
if 3.89999999999999997e-128 < z < 3.79999999999999998e134Initial program 97.1%
Taylor expanded in a around 0 75.3%
div-sub75.3%
*-inverses75.3%
Simplified75.3%
Taylor expanded in t around inf 74.9%
associate-*r/74.9%
mul-1-neg74.9%
distribute-rgt-neg-in74.9%
associate-/l*72.1%
Simplified72.1%
Taylor expanded in x around 0 74.9%
+-commutative74.9%
mul-1-neg74.9%
associate-*r/70.5%
sub-neg70.5%
Simplified70.5%
associate-*r/74.9%
associate-*l/74.6%
clear-num74.6%
associate-*l/74.6%
*-un-lft-identity74.6%
Applied egg-rr74.6%
Final simplification81.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+45)
(+ x y)
(if (<= z 3.95e-128)
(+ x (* y (/ t a)))
(if (<= z 1.85e+132) (- x (/ (* t y) z)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+45) {
tmp = x + y;
} else if (z <= 3.95e-128) {
tmp = x + (y * (t / a));
} else if (z <= 1.85e+132) {
tmp = x - ((t * y) / z);
} else {
tmp = x + 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 <= (-6.6d+45)) then
tmp = x + y
else if (z <= 3.95d-128) then
tmp = x + (y * (t / a))
else if (z <= 1.85d+132) then
tmp = x - ((t * y) / z)
else
tmp = x + 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 <= -6.6e+45) {
tmp = x + y;
} else if (z <= 3.95e-128) {
tmp = x + (y * (t / a));
} else if (z <= 1.85e+132) {
tmp = x - ((t * y) / z);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+45: tmp = x + y elif z <= 3.95e-128: tmp = x + (y * (t / a)) elif z <= 1.85e+132: tmp = x - ((t * y) / z) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+45) tmp = Float64(x + y); elseif (z <= 3.95e-128) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1.85e+132) tmp = Float64(x - Float64(Float64(t * y) / z)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.6e+45) tmp = x + y; elseif (z <= 3.95e-128) tmp = x + (y * (t / a)); elseif (z <= 1.85e+132) tmp = x - ((t * y) / z); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+45], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.95e-128], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+132], N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+45}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.95 \cdot 10^{-128}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+132}:\\
\;\;\;\;x - \frac{t \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6.6000000000000001e45 or 1.85000000000000005e132 < z Initial program 100.0%
Taylor expanded in z around inf 85.4%
if -6.6000000000000001e45 < z < 3.9500000000000001e-128Initial program 95.5%
Taylor expanded in z around 0 83.3%
if 3.9500000000000001e-128 < z < 1.85000000000000005e132Initial program 97.1%
Taylor expanded in a around 0 75.3%
div-sub75.3%
*-inverses75.3%
Simplified75.3%
Taylor expanded in t around inf 74.9%
associate-*r/74.9%
associate-*r*74.9%
neg-mul-174.9%
Simplified74.9%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-65) (not (<= z 3.9e-123))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-65) || !(z <= 3.9e-123)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.35d-65)) .or. (.not. (z <= 3.9d-123))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-65) || !(z <= 3.9e-123)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-65) or not (z <= 3.9e-123): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-65) || !(z <= 3.9e-123)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.35e-65) || ~((z <= 3.9e-123))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e-65], N[Not[LessEqual[z, 3.9e-123]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-65} \lor \neg \left(z \leq 3.9 \cdot 10^{-123}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.3499999999999999e-65 or 3.89999999999999976e-123 < z Initial program 98.3%
Taylor expanded in a around 0 82.9%
div-sub82.9%
*-inverses82.9%
Simplified82.9%
if -1.3499999999999999e-65 < z < 3.89999999999999976e-123Initial program 95.5%
Taylor expanded in z around 0 88.5%
associate-/l*89.6%
Simplified89.6%
associate-/r/89.9%
Applied egg-rr89.9%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e+47) (not (<= z 5.8e-113))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e+47) || !(z <= 5.8e-113)) {
tmp = x + y;
} 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 ((z <= (-7.5d+47)) .or. (.not. (z <= 5.8d-113))) then
tmp = x + y
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 ((z <= -7.5e+47) || !(z <= 5.8e-113)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e+47) or not (z <= 5.8e-113): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e+47) || !(z <= 5.8e-113)) tmp = Float64(x + y); 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 ((z <= -7.5e+47) || ~((z <= 5.8e-113))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e+47], N[Not[LessEqual[z, 5.8e-113]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+47} \lor \neg \left(z \leq 5.8 \cdot 10^{-113}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -7.4999999999999999e47 or 5.80000000000000008e-113 < z Initial program 98.7%
Taylor expanded in z around inf 75.7%
if -7.4999999999999999e47 < z < 5.80000000000000008e-113Initial program 95.6%
Taylor expanded in z around 0 82.2%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.3e+46) (+ x y) (if (<= z 6e-113) (+ x (* y (/ t a))) (+ x (* z (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+46) {
tmp = x + y;
} else if (z <= 6e-113) {
tmp = x + (y * (t / a));
} else {
tmp = x + (z * (y / 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) :: tmp
if (z <= (-1.3d+46)) then
tmp = x + y
else if (z <= 6d-113) then
tmp = x + (y * (t / a))
else
tmp = x + (z * (y / z))
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.3e+46) {
tmp = x + y;
} else if (z <= 6e-113) {
tmp = x + (y * (t / a));
} else {
tmp = x + (z * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+46: tmp = x + y elif z <= 6e-113: tmp = x + (y * (t / a)) else: tmp = x + (z * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+46) tmp = Float64(x + y); elseif (z <= 6e-113) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(z * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+46) tmp = x + y; elseif (z <= 6e-113) tmp = x + (y * (t / a)); else tmp = x + (z * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+46], N[(x + y), $MachinePrecision], If[LessEqual[z, 6e-113], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+46}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-113}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -1.30000000000000007e46Initial program 100.0%
Taylor expanded in z around inf 82.9%
if -1.30000000000000007e46 < z < 6.0000000000000002e-113Initial program 95.6%
Taylor expanded in z around 0 82.2%
if 6.0000000000000002e-113 < z Initial program 98.0%
Taylor expanded in t around 0 67.4%
associate-*l/81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in z around inf 72.0%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.5e+43) (+ x y) (if (<= z 3.2e-90) (+ x (/ y (/ a t))) (+ x (* z (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e+43) {
tmp = x + y;
} else if (z <= 3.2e-90) {
tmp = x + (y / (a / t));
} else {
tmp = x + (z * (y / 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) :: tmp
if (z <= (-9.5d+43)) then
tmp = x + y
else if (z <= 3.2d-90) then
tmp = x + (y / (a / t))
else
tmp = x + (z * (y / z))
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+43) {
tmp = x + y;
} else if (z <= 3.2e-90) {
tmp = x + (y / (a / t));
} else {
tmp = x + (z * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.5e+43: tmp = x + y elif z <= 3.2e-90: tmp = x + (y / (a / t)) else: tmp = x + (z * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e+43) tmp = Float64(x + y); elseif (z <= 3.2e-90) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(z * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.5e+43) tmp = x + y; elseif (z <= 3.2e-90) tmp = x + (y / (a / t)); else tmp = x + (z * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e+43], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.2e-90], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+43}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-90}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -9.5000000000000004e43Initial program 100.0%
Taylor expanded in z around inf 82.9%
if -9.5000000000000004e43 < z < 3.20000000000000007e-90Initial program 95.7%
Taylor expanded in z around 0 80.0%
associate-/l*80.8%
Simplified80.8%
if 3.20000000000000007e-90 < z Initial program 97.9%
Taylor expanded in t around 0 68.8%
associate-*l/83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in z around inf 73.6%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- z a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * 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 + (((z - t) / (z - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (z - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(z - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (z - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{z - a} \cdot y
\end{array}
Initial program 97.4%
Final simplification97.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.2e+91) x (if (<= a 1.7e+113) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.2e+91) {
tmp = x;
} else if (a <= 1.7e+113) {
tmp = x + y;
} 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 <= (-6.2d+91)) then
tmp = x
else if (a <= 1.7d+113) then
tmp = x + y
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 <= -6.2e+91) {
tmp = x;
} else if (a <= 1.7e+113) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.2e+91: tmp = x elif a <= 1.7e+113: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.2e+91) tmp = x; elseif (a <= 1.7e+113) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.2e+91) tmp = x; elseif (a <= 1.7e+113) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.2e+91], x, If[LessEqual[a, 1.7e+113], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+113}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.19999999999999995e91 or 1.70000000000000009e113 < a Initial program 98.9%
Taylor expanded in x around inf 71.1%
if -6.19999999999999995e91 < a < 1.70000000000000009e113Initial program 96.6%
Taylor expanded in z around inf 66.9%
Final simplification68.3%
(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.4%
Taylor expanded in x around inf 51.8%
Final simplification51.8%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023274
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))