
(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 10 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 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 (if (or (<= z -1.95e-46) (not (<= z 3500.0))) (+ x (* y (/ (- z t) z))) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e-46) || !(z <= 3500.0)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (t / (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 ((z <= (-1.95d-46)) .or. (.not. (z <= 3500.0d0))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (t / (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 ((z <= -1.95e-46) || !(z <= 3500.0)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e-46) or not (z <= 3500.0): tmp = x + (y * ((z - t) / z)) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e-46) || !(z <= 3500.0)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.95e-46) || ~((z <= 3500.0))) tmp = x + (y * ((z - t) / z)); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e-46], N[Not[LessEqual[z, 3500.0]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-46} \lor \neg \left(z \leq 3500\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.9500000000000001e-46 or 3500 < z Initial program 99.9%
Taylor expanded in a around 0 87.1%
if -1.9500000000000001e-46 < z < 3500Initial program 94.6%
Taylor expanded in z around 0 77.7%
+-commutative77.7%
associate-/l*80.1%
Simplified80.1%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+14) (not (<= t 3e-96))) (- x (* y (/ t (- z a)))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+14) || !(t <= 3e-96)) {
tmp = x - (y * (t / (z - a)));
} 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 <= (-1.05d+14)) .or. (.not. (t <= 3d-96))) then
tmp = x - (y * (t / (z - a)))
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 <= -1.05e+14) || !(t <= 3e-96)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+14) or not (t <= 3e-96): tmp = x - (y * (t / (z - a))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+14) || !(t <= 3e-96)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); 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 <= -1.05e+14) || ~((t <= 3e-96))) tmp = x - (y * (t / (z - a))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+14], N[Not[LessEqual[t, 3e-96]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $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 -1.05 \cdot 10^{+14} \lor \neg \left(t \leq 3 \cdot 10^{-96}\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -1.05e14 or 3e-96 < t Initial program 96.7%
Taylor expanded in t around inf 84.7%
neg-mul-184.7%
distribute-neg-frac84.7%
Simplified84.7%
*-commutative84.7%
add-sqr-sqrt42.0%
sqrt-unprod43.4%
sqr-neg43.4%
sqrt-unprod26.2%
add-sqr-sqrt44.4%
cancel-sign-sub44.4%
distribute-frac-neg44.4%
*-commutative44.4%
clear-num44.4%
un-div-inv45.1%
add-sqr-sqrt18.9%
sqrt-unprod41.3%
sqr-neg41.3%
sqrt-unprod43.4%
add-sqr-sqrt86.1%
Applied egg-rr86.1%
div-inv84.7%
clear-num84.7%
Applied egg-rr84.7%
if -1.05e14 < t < 3e-96Initial program 99.0%
Taylor expanded in t around 0 86.3%
+-commutative86.3%
associate-/l*97.2%
Simplified97.2%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -7000000000000.0) (- x (* y (/ t (- z a)))) (if (<= t 3.2e-96) (+ x (/ y (/ (- z a) z))) (- x (* t (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7000000000000.0) {
tmp = x - (y * (t / (z - a)));
} else if (t <= 3.2e-96) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - (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) :: tmp
if (t <= (-7000000000000.0d0)) then
tmp = x - (y * (t / (z - a)))
else if (t <= 3.2d-96) then
tmp = x + (y / ((z - a) / z))
else
tmp = x - (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 tmp;
if (t <= -7000000000000.0) {
tmp = x - (y * (t / (z - a)));
} else if (t <= 3.2e-96) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7000000000000.0: tmp = x - (y * (t / (z - a))) elif t <= 3.2e-96: tmp = x + (y / ((z - a) / z)) else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7000000000000.0) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); elseif (t <= 3.2e-96) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7000000000000.0) tmp = x - (y * (t / (z - a))); elseif (t <= 3.2e-96) tmp = x + (y / ((z - a) / z)); else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7000000000000.0], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-96], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7000000000000:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-96}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -7e12Initial program 97.3%
Taylor expanded in t around inf 88.1%
neg-mul-188.1%
distribute-neg-frac88.1%
Simplified88.1%
*-commutative88.1%
add-sqr-sqrt88.0%
sqrt-unprod52.1%
sqr-neg52.1%
sqrt-unprod0.0%
add-sqr-sqrt38.2%
cancel-sign-sub38.2%
distribute-frac-neg38.2%
*-commutative38.2%
clear-num38.2%
un-div-inv39.6%
add-sqr-sqrt39.6%
sqrt-unprod23.3%
sqr-neg23.3%
sqrt-unprod0.0%
add-sqr-sqrt89.4%
Applied egg-rr89.4%
div-inv88.0%
clear-num88.1%
Applied egg-rr88.1%
if -7e12 < t < 3.20000000000000012e-96Initial program 99.0%
Taylor expanded in t around 0 86.3%
+-commutative86.3%
associate-/l*97.2%
Simplified97.2%
if 3.20000000000000012e-96 < t Initial program 96.2%
Taylor expanded in t around inf 81.7%
neg-mul-181.7%
distribute-neg-frac81.7%
Simplified81.7%
Taylor expanded in x around 0 80.6%
mul-1-neg80.6%
*-commutative80.6%
associate-/l*83.1%
sub-neg83.1%
associate-/r/84.0%
Simplified84.0%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.6e+16) (- x (/ y (/ (- z a) t))) (if (<= t 3.4e-96) (+ x (/ y (/ (- z a) z))) (- x (* t (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.6e+16) {
tmp = x - (y / ((z - a) / t));
} else if (t <= 3.4e-96) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - (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) :: tmp
if (t <= (-2.6d+16)) then
tmp = x - (y / ((z - a) / t))
else if (t <= 3.4d-96) then
tmp = x + (y / ((z - a) / z))
else
tmp = x - (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 tmp;
if (t <= -2.6e+16) {
tmp = x - (y / ((z - a) / t));
} else if (t <= 3.4e-96) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.6e+16: tmp = x - (y / ((z - a) / t)) elif t <= 3.4e-96: tmp = x + (y / ((z - a) / z)) else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.6e+16) tmp = Float64(x - Float64(y / Float64(Float64(z - a) / t))); elseif (t <= 3.4e-96) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.6e+16) tmp = x - (y / ((z - a) / t)); elseif (t <= 3.4e-96) tmp = x + (y / ((z - a) / z)); else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.6e+16], N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e-96], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+16}:\\
\;\;\;\;x - \frac{y}{\frac{z - a}{t}}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-96}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -2.6e16Initial program 97.3%
Taylor expanded in t around inf 88.1%
neg-mul-188.1%
distribute-neg-frac88.1%
Simplified88.1%
*-commutative88.1%
add-sqr-sqrt88.0%
sqrt-unprod52.1%
sqr-neg52.1%
sqrt-unprod0.0%
add-sqr-sqrt38.2%
cancel-sign-sub38.2%
distribute-frac-neg38.2%
*-commutative38.2%
clear-num38.2%
un-div-inv39.6%
add-sqr-sqrt39.6%
sqrt-unprod23.3%
sqr-neg23.3%
sqrt-unprod0.0%
add-sqr-sqrt89.4%
Applied egg-rr89.4%
if -2.6e16 < t < 3.4000000000000001e-96Initial program 99.0%
Taylor expanded in t around 0 86.3%
+-commutative86.3%
associate-/l*97.2%
Simplified97.2%
if 3.4000000000000001e-96 < t Initial program 96.2%
Taylor expanded in t around inf 81.7%
neg-mul-181.7%
distribute-neg-frac81.7%
Simplified81.7%
Taylor expanded in x around 0 80.6%
mul-1-neg80.6%
*-commutative80.6%
associate-/l*83.1%
sub-neg83.1%
associate-/r/84.0%
Simplified84.0%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e+22) (not (<= z 15500000.0))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+22) || !(z <= 15500000.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 <= (-2.4d+22)) .or. (.not. (z <= 15500000.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 <= -2.4e+22) || !(z <= 15500000.0)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e+22) or not (z <= 15500000.0): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e+22) || !(z <= 15500000.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 <= -2.4e+22) || ~((z <= 15500000.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, -2.4e+22], N[Not[LessEqual[z, 15500000.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 -2.4 \cdot 10^{+22} \lor \neg \left(z \leq 15500000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -2.4e22 or 1.55e7 < z Initial program 99.9%
Taylor expanded in z around inf 78.6%
+-commutative78.6%
Simplified78.6%
if -2.4e22 < z < 1.55e7Initial program 95.2%
Taylor expanded in z around 0 74.8%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e+105) (not (<= z 280000000000.0))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e+105) || !(z <= 280000000000.0)) {
tmp = x + y;
} 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 <= (-5.5d+105)) .or. (.not. (z <= 280000000000.0d0))) then
tmp = x + y
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 <= -5.5e+105) || !(z <= 280000000000.0)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e+105) or not (z <= 280000000000.0): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e+105) || !(z <= 280000000000.0)) tmp = Float64(x + y); 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 <= -5.5e+105) || ~((z <= 280000000000.0))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e+105], N[Not[LessEqual[z, 280000000000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+105} \lor \neg \left(z \leq 280000000000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.49999999999999979e105 or 2.8e11 < z Initial program 99.9%
Taylor expanded in z around inf 81.0%
+-commutative81.0%
Simplified81.0%
if -5.49999999999999979e105 < z < 2.8e11Initial program 95.7%
Taylor expanded in z around 0 72.3%
+-commutative72.3%
associate-/l*74.3%
Simplified74.3%
Taylor expanded in t around 0 72.3%
associate-*r/73.6%
Simplified73.6%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e+105) (not (<= z 5000000.0))) (+ x y) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e+105) || !(z <= 5000000.0)) {
tmp = x + y;
} else {
tmp = x + (t / (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 ((z <= (-5.5d+105)) .or. (.not. (z <= 5000000.0d0))) then
tmp = x + y
else
tmp = x + (t / (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 ((z <= -5.5e+105) || !(z <= 5000000.0)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e+105) or not (z <= 5000000.0): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e+105) || !(z <= 5000000.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.5e+105) || ~((z <= 5000000.0))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e+105], N[Not[LessEqual[z, 5000000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+105} \lor \neg \left(z \leq 5000000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -5.49999999999999979e105 or 5e6 < z Initial program 99.9%
Taylor expanded in z around inf 81.0%
+-commutative81.0%
Simplified81.0%
if -5.49999999999999979e105 < z < 5e6Initial program 95.7%
Taylor expanded in z around 0 72.3%
+-commutative72.3%
associate-/l*74.3%
Simplified74.3%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (<= a 2.6e+199) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.6e+199) {
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 <= 2.6d+199) 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 <= 2.6e+199) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.6e+199: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.6e+199) 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 <= 2.6e+199) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.6e+199], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.6 \cdot 10^{+199}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.6000000000000001e199Initial program 97.9%
Taylor expanded in z around inf 66.7%
+-commutative66.7%
Simplified66.7%
if 2.6000000000000001e199 < a Initial program 95.4%
Taylor expanded in x around inf 72.8%
Final simplification67.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 97.7%
Taylor expanded in x around inf 53.3%
Final simplification53.3%
(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 2023319
(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)))))