
(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 (+ 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}
Initial program 99.2%
clear-num99.2%
un-div-inv99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (/ y z)))))
(if (<= z -6.6e+149)
(+ x y)
(if (<= z -70000.0)
t_1
(if (<= z 8.8e-23)
(+ x (/ y (/ a t)))
(if (<= z 9e+57)
t_1
(if (<= z 8.5e+75) (+ x (* t (/ y a))) (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / z));
double tmp;
if (z <= -6.6e+149) {
tmp = x + y;
} else if (z <= -70000.0) {
tmp = t_1;
} else if (z <= 8.8e-23) {
tmp = x + (y / (a / t));
} else if (z <= 9e+57) {
tmp = t_1;
} else if (z <= 8.5e+75) {
tmp = x + (t * (y / 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) :: t_1
real(8) :: tmp
t_1 = x - (t * (y / z))
if (z <= (-6.6d+149)) then
tmp = x + y
else if (z <= (-70000.0d0)) then
tmp = t_1
else if (z <= 8.8d-23) then
tmp = x + (y / (a / t))
else if (z <= 9d+57) then
tmp = t_1
else if (z <= 8.5d+75) then
tmp = x + (t * (y / 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 t_1 = x - (t * (y / z));
double tmp;
if (z <= -6.6e+149) {
tmp = x + y;
} else if (z <= -70000.0) {
tmp = t_1;
} else if (z <= 8.8e-23) {
tmp = x + (y / (a / t));
} else if (z <= 9e+57) {
tmp = t_1;
} else if (z <= 8.5e+75) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (y / z)) tmp = 0 if z <= -6.6e+149: tmp = x + y elif z <= -70000.0: tmp = t_1 elif z <= 8.8e-23: tmp = x + (y / (a / t)) elif z <= 9e+57: tmp = t_1 elif z <= 8.5e+75: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(y / z))) tmp = 0.0 if (z <= -6.6e+149) tmp = Float64(x + y); elseif (z <= -70000.0) tmp = t_1; elseif (z <= 8.8e-23) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 9e+57) tmp = t_1; elseif (z <= 8.5e+75) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (y / z)); tmp = 0.0; if (z <= -6.6e+149) tmp = x + y; elseif (z <= -70000.0) tmp = t_1; elseif (z <= 8.8e-23) tmp = x + (y / (a / t)); elseif (z <= 9e+57) tmp = t_1; elseif (z <= 8.5e+75) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+149], N[(x + y), $MachinePrecision], If[LessEqual[z, -70000.0], t$95$1, If[LessEqual[z, 8.8e-23], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+57], t$95$1, If[LessEqual[z, 8.5e+75], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+149}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -70000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-23}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+75}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6.6e149 or 8.4999999999999993e75 < z Initial program 100.0%
Taylor expanded in z around inf 85.1%
+-commutative85.1%
Simplified85.1%
if -6.6e149 < z < -7e4 or 8.7999999999999998e-23 < z < 8.99999999999999991e57Initial program 99.8%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 76.6%
associate-*r/76.6%
neg-mul-176.6%
sub-neg76.6%
distribute-neg-in76.6%
remove-double-neg76.6%
Simplified76.6%
Taylor expanded in z around inf 67.1%
mul-1-neg67.1%
unsub-neg67.1%
associate-/l*72.9%
Simplified72.9%
if -7e4 < z < 8.7999999999999998e-23Initial program 98.3%
clear-num98.4%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in z around 0 81.7%
if 8.99999999999999991e57 < z < 8.4999999999999993e75Initial program 100.0%
Taylor expanded in z around 0 62.8%
+-commutative62.8%
associate-/l*73.3%
Simplified73.3%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.8e+149)
(+ x y)
(if (<= z -1450.0)
(- x (* t (/ y z)))
(if (<= z 6.5e-23)
(+ x (/ y (/ a t)))
(if (<= z 1.6e+58)
(- x (/ y (/ z t)))
(if (<= z 4.4e+83) (+ x (* t (/ y a))) (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+149) {
tmp = x + y;
} else if (z <= -1450.0) {
tmp = x - (t * (y / z));
} else if (z <= 6.5e-23) {
tmp = x + (y / (a / t));
} else if (z <= 1.6e+58) {
tmp = x - (y / (z / t));
} else if (z <= 4.4e+83) {
tmp = x + (t * (y / 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 <= (-3.8d+149)) then
tmp = x + y
else if (z <= (-1450.0d0)) then
tmp = x - (t * (y / z))
else if (z <= 6.5d-23) then
tmp = x + (y / (a / t))
else if (z <= 1.6d+58) then
tmp = x - (y / (z / t))
else if (z <= 4.4d+83) then
tmp = x + (t * (y / 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 <= -3.8e+149) {
tmp = x + y;
} else if (z <= -1450.0) {
tmp = x - (t * (y / z));
} else if (z <= 6.5e-23) {
tmp = x + (y / (a / t));
} else if (z <= 1.6e+58) {
tmp = x - (y / (z / t));
} else if (z <= 4.4e+83) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e+149: tmp = x + y elif z <= -1450.0: tmp = x - (t * (y / z)) elif z <= 6.5e-23: tmp = x + (y / (a / t)) elif z <= 1.6e+58: tmp = x - (y / (z / t)) elif z <= 4.4e+83: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e+149) tmp = Float64(x + y); elseif (z <= -1450.0) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 6.5e-23) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 1.6e+58) tmp = Float64(x - Float64(y / Float64(z / t))); elseif (z <= 4.4e+83) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.8e+149) tmp = x + y; elseif (z <= -1450.0) tmp = x - (t * (y / z)); elseif (z <= 6.5e-23) tmp = x + (y / (a / t)); elseif (z <= 1.6e+58) tmp = x - (y / (z / t)); elseif (z <= 4.4e+83) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+149], N[(x + y), $MachinePrecision], If[LessEqual[z, -1450.0], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-23], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+58], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+83], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+149}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1450:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-23}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+58}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+83}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.8000000000000001e149 or 4.39999999999999997e83 < z Initial program 100.0%
Taylor expanded in z around inf 85.1%
+-commutative85.1%
Simplified85.1%
if -3.8000000000000001e149 < z < -1450Initial program 99.9%
clear-num100.0%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 78.1%
associate-*r/78.1%
neg-mul-178.1%
sub-neg78.1%
distribute-neg-in78.1%
remove-double-neg78.1%
Simplified78.1%
Taylor expanded in z around inf 68.5%
mul-1-neg68.5%
unsub-neg68.5%
associate-/l*75.0%
Simplified75.0%
if -1450 < z < 6.5e-23Initial program 98.3%
clear-num98.4%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in z around 0 81.7%
if 6.5e-23 < z < 1.60000000000000008e58Initial program 99.7%
clear-num99.7%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 74.3%
associate-*r/74.3%
neg-mul-174.3%
sub-neg74.3%
distribute-neg-in74.3%
remove-double-neg74.3%
Simplified74.3%
Taylor expanded in z around inf 64.9%
mul-1-neg64.9%
unsub-neg64.9%
associate-/l*69.7%
Simplified69.7%
*-commutative69.7%
add-sqr-sqrt69.5%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-unprod0.0%
add-sqr-sqrt33.3%
associate-/r/33.3%
add-sqr-sqrt0.0%
sqrt-unprod69.8%
sqr-neg69.8%
sqrt-unprod69.5%
add-sqr-sqrt69.8%
Applied egg-rr69.8%
if 1.60000000000000008e58 < z < 4.39999999999999997e83Initial program 100.0%
Taylor expanded in z around 0 62.8%
+-commutative62.8%
associate-/l*73.3%
Simplified73.3%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.7e-88) (not (<= z 5e-23))) (+ x (* y (/ (- z t) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.7e-88) || !(z <= 5e-23)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.7d-88)) .or. (.not. (z <= 5d-23))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.7e-88) || !(z <= 5e-23)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.7e-88) or not (z <= 5e-23): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.7e-88) || !(z <= 5e-23)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.7e-88) || ~((z <= 5e-23))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.7e-88], N[Not[LessEqual[z, 5e-23]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{-88} \lor \neg \left(z \leq 5 \cdot 10^{-23}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -4.7e-88 or 5.0000000000000002e-23 < z Initial program 99.2%
Taylor expanded in a around 0 83.5%
if -4.7e-88 < z < 5.0000000000000002e-23Initial program 99.1%
clear-num99.1%
un-div-inv99.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 85.1%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e-88) (not (<= z 5e-23))) (+ x (/ y (/ z (- z t)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e-88) || !(z <= 5e-23)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-6.5d-88)) .or. (.not. (z <= 5d-23))) then
tmp = x + (y / (z / (z - t)))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e-88) || !(z <= 5e-23)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e-88) or not (z <= 5e-23): tmp = x + (y / (z / (z - t))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.5e-88) || !(z <= 5e-23)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.5e-88) || ~((z <= 5e-23))) tmp = x + (y / (z / (z - t))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.5e-88], N[Not[LessEqual[z, 5e-23]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-88} \lor \neg \left(z \leq 5 \cdot 10^{-23}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -6.50000000000000006e-88 or 5.0000000000000002e-23 < z Initial program 99.2%
clear-num99.2%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 84.2%
if -6.50000000000000006e-88 < z < 5.0000000000000002e-23Initial program 99.1%
clear-num99.1%
un-div-inv99.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 85.1%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+149) (not (<= z 3.7e+70))) (+ x (* y (/ (- z t) z))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+149) || !(z <= 3.7e+70)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (t * (y / (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 ((z <= (-3.7d+149)) .or. (.not. (z <= 3.7d+70))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (t * (y / (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 ((z <= -3.7e+149) || !(z <= 3.7e+70)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+149) or not (z <= 3.7e+70): tmp = x + (y * ((z - t) / z)) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+149) || !(z <= 3.7e+70)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.7e+149) || ~((z <= 3.7e+70))) tmp = x + (y * ((z - t) / z)); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+149], N[Not[LessEqual[z, 3.7e+70]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+149} \lor \neg \left(z \leq 3.7 \cdot 10^{+70}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -3.69999999999999978e149 or 3.69999999999999989e70 < z Initial program 100.0%
Taylor expanded in a around 0 94.2%
if -3.69999999999999978e149 < z < 3.69999999999999989e70Initial program 98.8%
clear-num98.8%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in t around inf 86.3%
associate-*r/86.3%
neg-mul-186.3%
sub-neg86.3%
distribute-neg-in86.3%
remove-double-neg86.3%
Simplified86.3%
Taylor expanded in x around 0 83.6%
+-commutative83.6%
associate-/l*84.7%
Simplified84.7%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.1e-95) (not (<= t 4e-23))) (+ x (* t (/ y (- a z)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e-95) || !(t <= 4e-23)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.1d-95)) .or. (.not. (t <= 4d-23))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e-95) || !(t <= 4e-23)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.1e-95) or not (t <= 4e-23): tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.1e-95) || !(t <= 4e-23)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.1e-95) || ~((t <= 4e-23))) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.1e-95], N[Not[LessEqual[t, 4e-23]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-95} \lor \neg \left(t \leq 4 \cdot 10^{-23}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -4.0999999999999997e-95 or 3.99999999999999984e-23 < t Initial program 98.6%
clear-num98.6%
un-div-inv99.3%
Applied egg-rr99.3%
Taylor expanded in t around inf 87.9%
associate-*r/87.9%
neg-mul-187.9%
sub-neg87.9%
distribute-neg-in87.9%
remove-double-neg87.9%
Simplified87.9%
Taylor expanded in x around 0 80.6%
+-commutative80.6%
associate-/l*87.9%
Simplified87.9%
if -4.0999999999999997e-95 < t < 3.99999999999999984e-23Initial program 99.9%
Taylor expanded in t around 0 78.8%
+-commutative78.8%
associate-/l*94.8%
Simplified94.8%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -4e-95) (+ x (/ y (/ (- a z) t))) (if (<= t 1.15e-21) (+ x (* y (/ z (- z a)))) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e-95) {
tmp = x + (y / ((a - z) / t));
} else if (t <= 1.15e-21) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / (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 <= (-4d-95)) then
tmp = x + (y / ((a - z) / t))
else if (t <= 1.15d-21) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (t * (y / (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 <= -4e-95) {
tmp = x + (y / ((a - z) / t));
} else if (t <= 1.15e-21) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4e-95: tmp = x + (y / ((a - z) / t)) elif t <= 1.15e-21: tmp = x + (y * (z / (z - a))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4e-95) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); elseif (t <= 1.15e-21) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4e-95) tmp = x + (y / ((a - z) / t)); elseif (t <= 1.15e-21) tmp = x + (y * (z / (z - a))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4e-95], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-21], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-95}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-21}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if t < -3.99999999999999996e-95Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 88.3%
associate-*r/88.3%
neg-mul-188.3%
sub-neg88.3%
distribute-neg-in88.3%
remove-double-neg88.3%
Simplified88.3%
if -3.99999999999999996e-95 < t < 1.15e-21Initial program 99.9%
Taylor expanded in t around 0 78.8%
+-commutative78.8%
associate-/l*94.8%
Simplified94.8%
if 1.15e-21 < t Initial program 96.9%
clear-num97.0%
un-div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in t around inf 87.3%
associate-*r/87.3%
neg-mul-187.3%
sub-neg87.3%
distribute-neg-in87.3%
remove-double-neg87.3%
Simplified87.3%
Taylor expanded in x around 0 86.0%
+-commutative86.0%
associate-/l*88.6%
Simplified88.6%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e-69) (not (<= z 8.5e+75))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e-69) || !(z <= 8.5e+75)) {
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 <= (-3.2d-69)) .or. (.not. (z <= 8.5d+75))) 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 <= -3.2e-69) || !(z <= 8.5e+75)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e-69) or not (z <= 8.5e+75): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e-69) || !(z <= 8.5e+75)) 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 <= -3.2e-69) || ~((z <= 8.5e+75))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e-69], N[Not[LessEqual[z, 8.5e+75]], $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 -3.2 \cdot 10^{-69} \lor \neg \left(z \leq 8.5 \cdot 10^{+75}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.19999999999999999e-69 or 8.4999999999999993e75 < z Initial program 99.1%
Taylor expanded in z around inf 75.4%
+-commutative75.4%
Simplified75.4%
if -3.19999999999999999e-69 < z < 8.4999999999999993e75Initial program 99.3%
Taylor expanded in z around 0 77.1%
*-commutative77.1%
associate-/l*77.8%
Simplified77.8%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -63000000.0) (not (<= z 8.5e+75))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -63000000.0) || !(z <= 8.5e+75)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-63000000.0d0)) .or. (.not. (z <= 8.5d+75))) then
tmp = x + y
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -63000000.0) || !(z <= 8.5e+75)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -63000000.0) or not (z <= 8.5e+75): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -63000000.0) || !(z <= 8.5e+75)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -63000000.0) || ~((z <= 8.5e+75))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -63000000.0], N[Not[LessEqual[z, 8.5e+75]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -63000000 \lor \neg \left(z \leq 8.5 \cdot 10^{+75}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -6.3e7 or 8.4999999999999993e75 < z Initial program 100.0%
Taylor expanded in z around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -6.3e7 < z < 8.4999999999999993e75Initial program 98.6%
clear-num98.6%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 76.3%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.4e+21) x (if (<= a 9.5e+133) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.4e+21) {
tmp = x;
} else if (a <= 9.5e+133) {
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 <= (-8.4d+21)) then
tmp = x
else if (a <= 9.5d+133) 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 <= -8.4e+21) {
tmp = x;
} else if (a <= 9.5e+133) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.4e+21: tmp = x elif a <= 9.5e+133: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.4e+21) tmp = x; elseif (a <= 9.5e+133) 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 <= -8.4e+21) tmp = x; elseif (a <= 9.5e+133) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.4e+21], x, If[LessEqual[a, 9.5e+133], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.4 \cdot 10^{+21}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{+133}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.4e21 or 9.49999999999999996e133 < a Initial program 99.9%
Taylor expanded in x around inf 74.4%
if -8.4e21 < a < 9.49999999999999996e133Initial program 98.7%
Taylor expanded in z around inf 60.6%
+-commutative60.6%
Simplified60.6%
Final simplification65.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 99.2%
Final simplification99.2%
(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.2%
Taylor expanded in x around inf 52.0%
Final simplification52.0%
(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 2024115
(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)))))