
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7e+138)
(+ x y)
(if (<= t -3.1e+72)
(- x (* y (/ z t)))
(if (<= t 1e+43) (+ x (/ y (/ a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+138) {
tmp = x + y;
} else if (t <= -3.1e+72) {
tmp = x - (y * (z / t));
} else if (t <= 1e+43) {
tmp = x + (y / (a / 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 (t <= (-7d+138)) then
tmp = x + y
else if (t <= (-3.1d+72)) then
tmp = x - (y * (z / t))
else if (t <= 1d+43) then
tmp = x + (y / (a / 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 (t <= -7e+138) {
tmp = x + y;
} else if (t <= -3.1e+72) {
tmp = x - (y * (z / t));
} else if (t <= 1e+43) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e+138: tmp = x + y elif t <= -3.1e+72: tmp = x - (y * (z / t)) elif t <= 1e+43: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+138) tmp = Float64(x + y); elseif (t <= -3.1e+72) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 1e+43) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e+138) tmp = x + y; elseif (t <= -3.1e+72) tmp = x - (y * (z / t)); elseif (t <= 1e+43) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+138], N[(x + y), $MachinePrecision], If[LessEqual[t, -3.1e+72], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+43], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+138}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{+72}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 10^{+43}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.9999999999999996e138 or 1.00000000000000001e43 < t Initial program 100.0%
Taylor expanded in t around inf 82.1%
if -6.9999999999999996e138 < t < -3.09999999999999988e72Initial program 99.5%
Taylor expanded in z around inf 93.3%
Taylor expanded in x around 0 93.5%
+-commutative93.5%
*-commutative93.5%
associate-/l*87.2%
Simplified87.2%
Taylor expanded in a around 0 87.0%
mul-1-neg87.0%
associate-*r/86.8%
sub-neg86.8%
Simplified86.8%
if -3.09999999999999988e72 < t < 1.00000000000000001e43Initial program 99.9%
Taylor expanded in t around 0 71.4%
associate-/l*77.7%
Simplified77.7%
Final simplification79.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.65e+136)
(+ x y)
(if (<= t -3.25e+72)
(- x (/ y (/ t z)))
(if (<= t 3.2e+42) (+ x (/ y (/ a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.65e+136) {
tmp = x + y;
} else if (t <= -3.25e+72) {
tmp = x - (y / (t / z));
} else if (t <= 3.2e+42) {
tmp = x + (y / (a / 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 (t <= (-1.65d+136)) then
tmp = x + y
else if (t <= (-3.25d+72)) then
tmp = x - (y / (t / z))
else if (t <= 3.2d+42) then
tmp = x + (y / (a / 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 (t <= -1.65e+136) {
tmp = x + y;
} else if (t <= -3.25e+72) {
tmp = x - (y / (t / z));
} else if (t <= 3.2e+42) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.65e+136: tmp = x + y elif t <= -3.25e+72: tmp = x - (y / (t / z)) elif t <= 3.2e+42: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.65e+136) tmp = Float64(x + y); elseif (t <= -3.25e+72) tmp = Float64(x - Float64(y / Float64(t / z))); elseif (t <= 3.2e+42) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.65e+136) tmp = x + y; elseif (t <= -3.25e+72) tmp = x - (y / (t / z)); elseif (t <= 3.2e+42) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.65e+136], N[(x + y), $MachinePrecision], If[LessEqual[t, -3.25e+72], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+42], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -3.25 \cdot 10^{+72}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.64999999999999996e136 or 3.20000000000000002e42 < t Initial program 100.0%
Taylor expanded in t around inf 82.1%
if -1.64999999999999996e136 < t < -3.2500000000000001e72Initial program 99.5%
Taylor expanded in z around inf 93.5%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in a around 0 87.0%
mul-1-neg87.0%
unsub-neg87.0%
associate-/l*87.1%
Simplified87.1%
if -3.2500000000000001e72 < t < 3.20000000000000002e42Initial program 99.9%
Taylor expanded in t around 0 71.4%
associate-/l*77.7%
Simplified77.7%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.5e+137) (not (<= t 5.6e+63))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.5e+137) || !(t <= 5.6e+63)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (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 ((t <= (-6.5d+137)) .or. (.not. (t <= 5.6d+63))) then
tmp = x + y
else
tmp = x + (y * (z / (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 ((t <= -6.5e+137) || !(t <= 5.6e+63)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.5e+137) or not (t <= 5.6e+63): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.5e+137) || !(t <= 5.6e+63)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.5e+137) || ~((t <= 5.6e+63))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.5e+137], N[Not[LessEqual[t, 5.6e+63]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+137} \lor \neg \left(t \leq 5.6 \cdot 10^{+63}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -6.5000000000000002e137 or 5.59999999999999974e63 < t Initial program 100.0%
Taylor expanded in t around inf 83.7%
if -6.5000000000000002e137 < t < 5.59999999999999974e63Initial program 99.8%
Taylor expanded in z around inf 87.6%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e-49) (not (<= z 1.05e+56))) (+ x (* y (/ z (- a t)))) (+ x (* y (/ t (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e-49) || !(z <= 1.05e+56)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y * (t / (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-49)) .or. (.not. (z <= 1.05d+56))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (y * (t / (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-49) || !(z <= 1.05e+56)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e-49) or not (z <= 1.05e+56): tmp = x + (y * (z / (a - t))) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e-49) || !(z <= 1.05e+56)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.2e-49) || ~((z <= 1.05e+56))) tmp = x + (y * (z / (a - t))); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e-49], N[Not[LessEqual[z, 1.05e+56]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-49} \lor \neg \left(z \leq 1.05 \cdot 10^{+56}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if z < -1.19999999999999996e-49 or 1.05000000000000009e56 < z Initial program 99.8%
Taylor expanded in z around inf 90.8%
if -1.19999999999999996e-49 < z < 1.05000000000000009e56Initial program 99.9%
Taylor expanded in z around 0 93.7%
neg-mul-193.7%
distribute-neg-frac93.7%
Simplified93.7%
*-commutative93.7%
div-inv93.7%
associate-*l*87.3%
add-sqr-sqrt37.3%
sqrt-unprod54.3%
sqr-neg54.3%
sqrt-unprod34.7%
add-sqr-sqrt61.5%
associate-/r/61.5%
div-inv61.5%
frac-2neg61.5%
add-sqr-sqrt26.8%
sqrt-unprod58.1%
sqr-neg58.1%
sqrt-unprod49.8%
add-sqr-sqrt87.6%
distribute-neg-frac87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Applied egg-rr87.6%
associate-/r/93.7%
+-commutative93.7%
unsub-neg93.7%
Simplified93.7%
Final simplification92.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e+86) (not (<= t 2.7e+42))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e+86) || !(t <= 2.7e+42)) {
tmp = x + y;
} else {
tmp = x + (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 ((t <= (-7d+86)) .or. (.not. (t <= 2.7d+42))) then
tmp = x + y
else
tmp = x + (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 ((t <= -7e+86) || !(t <= 2.7e+42)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e+86) or not (t <= 2.7e+42): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7e+86) || !(t <= 2.7e+42)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7e+86) || ~((t <= 2.7e+42))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7e+86], N[Not[LessEqual[t, 2.7e+42]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+86} \lor \neg \left(t \leq 2.7 \cdot 10^{+42}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -7.00000000000000038e86 or 2.7000000000000001e42 < t Initial program 99.9%
Taylor expanded in t around inf 79.2%
if -7.00000000000000038e86 < t < 2.7000000000000001e42Initial program 99.9%
Taylor expanded in t around 0 77.1%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.7e+86) (not (<= t 3.4e+43))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.7e+86) || !(t <= 3.4e+43)) {
tmp = x + y;
} else {
tmp = x + (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 <= (-1.7d+86)) .or. (.not. (t <= 3.4d+43))) then
tmp = x + y
else
tmp = x + (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 <= -1.7e+86) || !(t <= 3.4e+43)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.7e+86) or not (t <= 3.4e+43): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.7e+86) || !(t <= 3.4e+43)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.7e+86) || ~((t <= 3.4e+43))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.7e+86], N[Not[LessEqual[t, 3.4e+43]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+86} \lor \neg \left(t \leq 3.4 \cdot 10^{+43}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.6999999999999999e86 or 3.40000000000000012e43 < t Initial program 99.9%
Taylor expanded in t around inf 79.2%
if -1.6999999999999999e86 < t < 3.40000000000000012e43Initial program 99.9%
Taylor expanded in t around 0 71.0%
associate-/l*77.1%
Simplified77.1%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.45e+107) x (if (<= a 7.6e+96) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.45e+107) {
tmp = x;
} else if (a <= 7.6e+96) {
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 <= (-1.45d+107)) then
tmp = x
else if (a <= 7.6d+96) 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 <= -1.45e+107) {
tmp = x;
} else if (a <= 7.6e+96) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.45e+107: tmp = x elif a <= 7.6e+96: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.45e+107) tmp = x; elseif (a <= 7.6e+96) 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 <= -1.45e+107) tmp = x; elseif (a <= 7.6e+96) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.45e+107], x, If[LessEqual[a, 7.6e+96], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{+107}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{+96}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.44999999999999994e107 or 7.6000000000000003e96 < a Initial program 99.9%
Taylor expanded in z around inf 79.4%
associate-/l*90.0%
Simplified90.0%
Taylor expanded in x around inf 71.4%
if -1.44999999999999994e107 < a < 7.6000000000000003e96Initial program 99.9%
Taylor expanded in t around inf 66.8%
Final simplification68.4%
(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.9%
Taylor expanded in z around inf 72.6%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in x around inf 53.1%
Final simplification53.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} 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 - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
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 - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2024021
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))