
(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 (if (<= x -5.3e-276) (+ x (/ y (/ (- z a) (- z t)))) (+ x (/ -1.0 (/ (/ (- z a) y) (- t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.3e-276) {
tmp = x + (y / ((z - a) / (z - t)));
} else {
tmp = x + (-1.0 / (((z - a) / y) / (t - 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 (x <= (-5.3d-276)) then
tmp = x + (y / ((z - a) / (z - t)))
else
tmp = x + ((-1.0d0) / (((z - a) / y) / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.3e-276) {
tmp = x + (y / ((z - a) / (z - t)));
} else {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -5.3e-276: tmp = x + (y / ((z - a) / (z - t))) else: tmp = x + (-1.0 / (((z - a) / y) / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -5.3e-276) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))); else tmp = Float64(x + Float64(-1.0 / Float64(Float64(Float64(z - a) / y) / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -5.3e-276) tmp = x + (y / ((z - a) / (z - t))); else tmp = x + (-1.0 / (((z - a) / y) / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -5.3e-276], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 / N[(N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.3 \cdot 10^{-276}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{\frac{\frac{z - a}{y}}{t - z}}\\
\end{array}
\end{array}
if x < -5.2999999999999997e-276Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
if -5.2999999999999997e-276 < x Initial program 95.4%
associate-*r/85.9%
clear-num85.8%
associate-/r*99.0%
Applied egg-rr99.0%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ (- z a) z)))))
(if (<= z -5.5e+170)
t_1
(if (<= z -1.7e-44)
(- x (/ (* y (- t z)) z))
(if (or (<= z -1.35e-177) (not (<= z 1.1e-54)))
t_1
(+ x (/ (* y t) a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((z - a) / z));
double tmp;
if (z <= -5.5e+170) {
tmp = t_1;
} else if (z <= -1.7e-44) {
tmp = x - ((y * (t - z)) / z);
} else if ((z <= -1.35e-177) || !(z <= 1.1e-54)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y / ((z - a) / z))
if (z <= (-5.5d+170)) then
tmp = t_1
else if (z <= (-1.7d-44)) then
tmp = x - ((y * (t - z)) / z)
else if ((z <= (-1.35d-177)) .or. (.not. (z <= 1.1d-54))) then
tmp = t_1
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 t_1 = x + (y / ((z - a) / z));
double tmp;
if (z <= -5.5e+170) {
tmp = t_1;
} else if (z <= -1.7e-44) {
tmp = x - ((y * (t - z)) / z);
} else if ((z <= -1.35e-177) || !(z <= 1.1e-54)) {
tmp = t_1;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((z - a) / z)) tmp = 0 if z <= -5.5e+170: tmp = t_1 elif z <= -1.7e-44: tmp = x - ((y * (t - z)) / z) elif (z <= -1.35e-177) or not (z <= 1.1e-54): tmp = t_1 else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(z - a) / z))) tmp = 0.0 if (z <= -5.5e+170) tmp = t_1; elseif (z <= -1.7e-44) tmp = Float64(x - Float64(Float64(y * Float64(t - z)) / z)); elseif ((z <= -1.35e-177) || !(z <= 1.1e-54)) tmp = t_1; else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / ((z - a) / z)); tmp = 0.0; if (z <= -5.5e+170) tmp = t_1; elseif (z <= -1.7e-44) tmp = x - ((y * (t - z)) / z); elseif ((z <= -1.35e-177) || ~((z <= 1.1e-54))) tmp = t_1; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+170], t$95$1, If[LessEqual[z, -1.7e-44], N[(x - N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.35e-177], N[Not[LessEqual[z, 1.1e-54]], $MachinePrecision]], t$95$1, N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-44}:\\
\;\;\;\;x - \frac{y \cdot \left(t - z\right)}{z}\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-177} \lor \neg \left(z \leq 1.1 \cdot 10^{-54}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -5.4999999999999999e170 or -1.70000000000000008e-44 < z < -1.3500000000000001e-177 or 1.1e-54 < z Initial program 99.2%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in t around 0 86.5%
if -5.4999999999999999e170 < z < -1.70000000000000008e-44Initial program 97.8%
Taylor expanded in a around 0 79.1%
if -1.3500000000000001e-177 < z < 1.1e-54Initial program 94.8%
Taylor expanded in z around 0 88.4%
Final simplification85.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.06e+134)
(+ x y)
(if (<= z -2.5e-106)
(- x (* t (/ y z)))
(if (<= z 8500.0) (+ x (/ (* y t) a)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.06e+134) {
tmp = x + y;
} else if (z <= -2.5e-106) {
tmp = x - (t * (y / z));
} else if (z <= 8500.0) {
tmp = x + ((y * t) / a);
} 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.06d+134)) then
tmp = x + y
else if (z <= (-2.5d-106)) then
tmp = x - (t * (y / z))
else if (z <= 8500.0d0) then
tmp = x + ((y * t) / a)
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.06e+134) {
tmp = x + y;
} else if (z <= -2.5e-106) {
tmp = x - (t * (y / z));
} else if (z <= 8500.0) {
tmp = x + ((y * t) / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.06e+134: tmp = x + y elif z <= -2.5e-106: tmp = x - (t * (y / z)) elif z <= 8500.0: tmp = x + ((y * t) / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.06e+134) tmp = Float64(x + y); elseif (z <= -2.5e-106) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 8500.0) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.06e+134) tmp = x + y; elseif (z <= -2.5e-106) tmp = x - (t * (y / z)); elseif (z <= 8500.0) tmp = x + ((y * t) / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.06e+134], N[(x + y), $MachinePrecision], If[LessEqual[z, -2.5e-106], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8500.0], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+134}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-106}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 8500:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.05999999999999999e134 or 8500 < z Initial program 99.9%
Taylor expanded in z around inf 79.0%
+-commutative79.0%
Simplified79.0%
if -1.05999999999999999e134 < z < -2.49999999999999991e-106Initial program 98.2%
associate-*r/94.9%
Simplified94.9%
Taylor expanded in z around 0 76.9%
mul-1-neg76.9%
distribute-lft-neg-out76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in z around inf 69.6%
mul-1-neg69.6%
unsub-neg69.6%
associate-/l*72.8%
Simplified72.8%
if -2.49999999999999991e-106 < z < 8500Initial program 95.5%
Taylor expanded in z around 0 84.0%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-177) (not (<= z 3e-55))) (+ x (/ y (/ (- z a) z))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-177) || !(z <= 3e-55)) {
tmp = x + (y / ((z - a) / z));
} 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 <= (-1.35d-177)) .or. (.not. (z <= 3d-55))) then
tmp = x + (y / ((z - a) / z))
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 <= -1.35e-177) || !(z <= 3e-55)) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-177) or not (z <= 3e-55): tmp = x + (y / ((z - a) / z)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-177) || !(z <= 3e-55)) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.35e-177) || ~((z <= 3e-55))) tmp = x + (y / ((z - a) / z)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e-177], N[Not[LessEqual[z, 3e-55]], $MachinePrecision]], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-177} \lor \neg \left(z \leq 3 \cdot 10^{-55}\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.3500000000000001e-177 or 3.00000000000000016e-55 < z Initial program 98.9%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in t around 0 81.8%
if -1.3500000000000001e-177 < z < 3.00000000000000016e-55Initial program 94.8%
Taylor expanded in z around 0 88.4%
Final simplification83.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e-121) (not (<= z 1.3e-81))) (+ x (/ (- z t) (/ z y))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e-121) || !(z <= 1.3e-81)) {
tmp = x + ((z - t) / (z / 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 <= (-1.85d-121)) .or. (.not. (z <= 1.3d-81))) then
tmp = x + ((z - t) / (z / 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 <= -1.85e-121) || !(z <= 1.3e-81)) {
tmp = x + ((z - t) / (z / y));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e-121) or not (z <= 1.3e-81): tmp = x + ((z - t) / (z / y)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e-121) || !(z <= 1.3e-81)) tmp = Float64(x + Float64(Float64(z - t) / Float64(z / y))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.85e-121) || ~((z <= 1.3e-81))) tmp = x + ((z - t) / (z / y)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e-121], N[Not[LessEqual[z, 1.3e-81]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-121} \lor \neg \left(z \leq 1.3 \cdot 10^{-81}\right):\\
\;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.8500000000000001e-121 or 1.2999999999999999e-81 < z Initial program 98.8%
clear-num98.8%
un-div-inv98.8%
Applied egg-rr98.8%
associate-/r/97.6%
clear-num97.5%
associate-*l/97.6%
*-un-lft-identity97.6%
add-cube-cbrt96.8%
*-un-lft-identity96.8%
times-frac96.8%
pow296.8%
Applied egg-rr96.8%
times-frac96.8%
unpow296.8%
rem-3cbrt-lft97.6%
*-lft-identity97.6%
Simplified97.6%
Taylor expanded in z around inf 84.5%
if -1.8500000000000001e-121 < z < 1.2999999999999999e-81Initial program 95.4%
Taylor expanded in z around 0 89.6%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2e+55) (not (<= t 8.2e+32))) (+ x (* t (/ y (- a z)))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e+55) || !(t <= 8.2e+32)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / 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 ((t <= (-2d+55)) .or. (.not. (t <= 8.2d+32))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y / ((z - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e+55) || !(t <= 8.2e+32)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2e+55) or not (t <= 8.2e+32): tmp = x + (t * (y / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2e+55) || !(t <= 8.2e+32)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2e+55) || ~((t <= 8.2e+32))) tmp = x + (t * (y / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2e+55], N[Not[LessEqual[t, 8.2e+32]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+55} \lor \neg \left(t \leq 8.2 \cdot 10^{+32}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -2.00000000000000002e55 or 8.19999999999999961e32 < t Initial program 94.0%
associate-*r/80.8%
Simplified80.8%
Taylor expanded in z around 0 77.7%
mul-1-neg77.7%
distribute-lft-neg-out77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in x around 0 77.7%
associate-*r/85.8%
neg-mul-185.8%
distribute-lft-neg-in85.8%
cancel-sign-sub-inv85.8%
Simplified85.8%
if -2.00000000000000002e55 < t < 8.19999999999999961e32Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 92.0%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.8e+58) (+ x (* t (/ y (- a z)))) (if (<= t 2.65e+31) (+ x (/ y (/ (- z a) z))) (+ x (* y (/ t (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+58) {
tmp = x + (t * (y / (a - z)));
} else if (t <= 2.65e+31) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x + (y * (t / (a - 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 (t <= (-4.8d+58)) then
tmp = x + (t * (y / (a - z)))
else if (t <= 2.65d+31) then
tmp = x + (y / ((z - a) / z))
else
tmp = x + (y * (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+58) {
tmp = x + (t * (y / (a - z)));
} else if (t <= 2.65e+31) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.8e+58: tmp = x + (t * (y / (a - z))) elif t <= 2.65e+31: tmp = x + (y / ((z - a) / z)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.8e+58) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (t <= 2.65e+31) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.8e+58) tmp = x + (t * (y / (a - z))); elseif (t <= 2.65e+31) tmp = x + (y / ((z - a) / z)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.8e+58], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.65e+31], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+58}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{+31}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if t < -4.8e58Initial program 91.6%
associate-*r/73.5%
Simplified73.5%
Taylor expanded in z around 0 69.0%
mul-1-neg69.0%
distribute-lft-neg-out69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in x around 0 69.0%
associate-*r/83.1%
neg-mul-183.1%
distribute-lft-neg-in83.1%
cancel-sign-sub-inv83.1%
Simplified83.1%
if -4.8e58 < t < 2.6500000000000002e31Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 92.0%
if 2.6500000000000002e31 < t Initial program 96.2%
Taylor expanded in t around inf 85.3%
associate-*r/85.3%
mul-1-neg85.3%
distribute-lft-neg-out85.3%
*-commutative85.3%
associate-/l*90.5%
distribute-neg-frac90.5%
distribute-neg-frac290.5%
sub-neg90.5%
mul-1-neg90.5%
distribute-neg-in90.5%
mul-1-neg90.5%
remove-double-neg90.5%
Simplified90.5%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e-30) (not (<= z 4000.0))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e-30) || !(z <= 4000.0)) {
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 <= (-1.2d-30)) .or. (.not. (z <= 4000.0d0))) 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 <= -1.2e-30) || !(z <= 4000.0)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e-30) or not (z <= 4000.0): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e-30) || !(z <= 4000.0)) 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 <= -1.2e-30) || ~((z <= 4000.0))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e-30], N[Not[LessEqual[z, 4000.0]], $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 -1.2 \cdot 10^{-30} \lor \neg \left(z \leq 4000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.19999999999999992e-30 or 4e3 < z Initial program 99.9%
Taylor expanded in z around inf 74.9%
+-commutative74.9%
Simplified74.9%
if -1.19999999999999992e-30 < z < 4e3Initial program 95.5%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
associate-/l*80.1%
Simplified80.1%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e-32) (not (<= z 12500.0))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.6e-32) || !(z <= 12500.0)) {
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 <= (-4.6d-32)) .or. (.not. (z <= 12500.0d0))) 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 <= -4.6e-32) || !(z <= 12500.0)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.6e-32) or not (z <= 12500.0): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.6e-32) || !(z <= 12500.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.6e-32) || ~((z <= 12500.0))) tmp = x + y; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.6e-32], N[Not[LessEqual[z, 12500.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-32} \lor \neg \left(z \leq 12500\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -4.6000000000000001e-32 or 12500 < z Initial program 99.9%
Taylor expanded in z around inf 74.9%
+-commutative74.9%
Simplified74.9%
if -4.6000000000000001e-32 < z < 12500Initial program 95.5%
Taylor expanded in z around 0 80.9%
Final simplification77.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.8e-276) (+ x (/ y (/ (- z a) (- z t)))) (+ x (/ (- z t) (/ (- z a) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.8e-276) {
tmp = x + (y / ((z - a) / (z - t)));
} else {
tmp = x + ((z - t) / ((z - 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 (x <= (-3.8d-276)) then
tmp = x + (y / ((z - a) / (z - t)))
else
tmp = x + ((z - t) / ((z - 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 (x <= -3.8e-276) {
tmp = x + (y / ((z - a) / (z - t)));
} else {
tmp = x + ((z - t) / ((z - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.8e-276: tmp = x + (y / ((z - a) / (z - t))) else: tmp = x + ((z - t) / ((z - a) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.8e-276) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -3.8e-276) tmp = x + (y / ((z - a) / (z - t))); else tmp = x + ((z - t) / ((z - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.8e-276], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-276}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\
\end{array}
\end{array}
if x < -3.8e-276Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
if -3.8e-276 < x Initial program 95.4%
clear-num95.3%
un-div-inv95.4%
Applied egg-rr95.4%
associate-/r/99.0%
clear-num98.9%
associate-*l/99.0%
*-un-lft-identity99.0%
add-cube-cbrt98.3%
*-un-lft-identity98.3%
times-frac98.3%
pow298.3%
Applied egg-rr98.3%
times-frac98.3%
unpow298.3%
rem-3cbrt-lft99.0%
*-lft-identity99.0%
Simplified99.0%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e-121) (not (<= z 3.8e-8))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-121) || !(z <= 3.8e-8)) {
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 ((z <= (-1.75d-121)) .or. (.not. (z <= 3.8d-8))) 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 ((z <= -1.75e-121) || !(z <= 3.8e-8)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e-121) or not (z <= 3.8e-8): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e-121) || !(z <= 3.8e-8)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.75e-121) || ~((z <= 3.8e-8))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e-121], N[Not[LessEqual[z, 3.8e-8]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-121} \lor \neg \left(z \leq 3.8 \cdot 10^{-8}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.74999999999999996e-121 or 3.80000000000000028e-8 < z Initial program 99.3%
Taylor expanded in z around inf 71.8%
+-commutative71.8%
Simplified71.8%
if -1.74999999999999996e-121 < z < 3.80000000000000028e-8Initial program 95.3%
Taylor expanded in x around inf 61.5%
Final simplification67.6%
(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}
Initial program 97.7%
Final simplification97.7%
(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.7%
Taylor expanded in x around inf 53.7%
Final simplification53.7%
(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 2024053
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))