
(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 9 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.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (- 1.0 (/ t z))))))
(if (<= z -3.05e+131)
t_1
(if (<= z -5.1e-17)
(+ x (/ (* y z) (- z a)))
(if (<= z 4.9e-20) (+ x (* t (/ y (- a z)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -3.05e+131) {
tmp = t_1;
} else if (z <= -5.1e-17) {
tmp = x + ((y * z) / (z - a));
} else if (z <= 4.9e-20) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * (1.0d0 - (t / z)))
if (z <= (-3.05d+131)) then
tmp = t_1
else if (z <= (-5.1d-17)) then
tmp = x + ((y * z) / (z - a))
else if (z <= 4.9d-20) then
tmp = x + (t * (y / (a - z)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -3.05e+131) {
tmp = t_1;
} else if (z <= -5.1e-17) {
tmp = x + ((y * z) / (z - a));
} else if (z <= 4.9e-20) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (1.0 - (t / z))) tmp = 0 if z <= -3.05e+131: tmp = t_1 elif z <= -5.1e-17: tmp = x + ((y * z) / (z - a)) elif z <= 4.9e-20: tmp = x + (t * (y / (a - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (z <= -3.05e+131) tmp = t_1; elseif (z <= -5.1e-17) tmp = Float64(x + Float64(Float64(y * z) / Float64(z - a))); elseif (z <= 4.9e-20) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (z <= -3.05e+131) tmp = t_1; elseif (z <= -5.1e-17) tmp = x + ((y * z) / (z - a)); elseif (z <= 4.9e-20) tmp = x + (t * (y / (a - z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.05e+131], t$95$1, If[LessEqual[z, -5.1e-17], N[(x + N[(N[(y * z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e-20], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -3.05 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{y \cdot z}{z - a}\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-20}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.0499999999999999e131 or 4.9000000000000002e-20 < z Initial program 99.9%
Taylor expanded in a around 0 74.5%
associate-/l*91.5%
div-sub91.5%
*-inverses91.5%
Simplified91.5%
if -3.0499999999999999e131 < z < -5.1000000000000003e-17Initial program 99.9%
Taylor expanded in t around 0 87.8%
if -5.1000000000000003e-17 < z < 4.9000000000000002e-20Initial program 95.0%
Taylor expanded in t around inf 92.4%
associate-*r/92.4%
mul-1-neg92.4%
distribute-lft-neg-out92.4%
*-commutative92.4%
*-lft-identity92.4%
times-frac89.8%
/-rgt-identity89.8%
distribute-neg-frac89.8%
distribute-neg-frac289.8%
neg-sub089.8%
sub-neg89.8%
+-commutative89.8%
associate--r+89.8%
neg-sub089.8%
remove-double-neg89.8%
Simplified89.8%
Taylor expanded in y around 0 92.4%
associate-/l*92.3%
Simplified92.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e-17) (not (<= z 1.3e-47))) (+ 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 ((z <= -5.2e-17) || !(z <= 1.3e-47)) {
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 ((z <= (-5.2d-17)) .or. (.not. (z <= 1.3d-47))) 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 ((z <= -5.2e-17) || !(z <= 1.3e-47)) {
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 (z <= -5.2e-17) or not (z <= 1.3e-47): 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 ((z <= -5.2e-17) || !(z <= 1.3e-47)) 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 ((z <= -5.2e-17) || ~((z <= 1.3e-47))) 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[Or[LessEqual[z, -5.2e-17], N[Not[LessEqual[z, 1.3e-47]], $MachinePrecision]], 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}\;z \leq -5.2 \cdot 10^{-17} \lor \neg \left(z \leq 1.3 \cdot 10^{-47}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -5.20000000000000006e-17 or 1.3e-47 < z Initial program 99.9%
Taylor expanded in t around 0 78.2%
+-commutative78.2%
associate-/l*92.1%
Simplified92.1%
if -5.20000000000000006e-17 < z < 1.3e-47Initial program 94.8%
Taylor expanded in t around inf 92.1%
associate-*r/92.1%
mul-1-neg92.1%
distribute-lft-neg-out92.1%
*-commutative92.1%
*-lft-identity92.1%
times-frac89.4%
/-rgt-identity89.4%
distribute-neg-frac89.4%
distribute-neg-frac289.4%
neg-sub089.4%
sub-neg89.4%
+-commutative89.4%
associate--r+89.4%
neg-sub089.4%
remove-double-neg89.4%
Simplified89.4%
Taylor expanded in y around 0 92.1%
associate-/l*92.0%
Simplified92.0%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e+117) (not (<= z 5e-20))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+117) || !(z <= 5e-20)) {
tmp = x + (y * (1.0 - (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 <= (-2.1d+117)) .or. (.not. (z <= 5d-20))) then
tmp = x + (y * (1.0d0 - (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 <= -2.1e+117) || !(z <= 5e-20)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e+117) or not (z <= 5e-20): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e+117) || !(z <= 5e-20)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(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 <= -2.1e+117) || ~((z <= 5e-20))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e+117], N[Not[LessEqual[z, 5e-20]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $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}\;z \leq -2.1 \cdot 10^{+117} \lor \neg \left(z \leq 5 \cdot 10^{-20}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -2.1000000000000001e117 or 4.9999999999999999e-20 < z Initial program 99.9%
Taylor expanded in a around 0 74.3%
associate-/l*90.8%
div-sub90.8%
*-inverses90.8%
Simplified90.8%
if -2.1000000000000001e117 < z < 4.9999999999999999e-20Initial program 95.7%
Taylor expanded in t around inf 89.3%
associate-*r/89.3%
mul-1-neg89.3%
distribute-lft-neg-out89.3%
*-commutative89.3%
*-lft-identity89.3%
times-frac87.7%
/-rgt-identity87.7%
distribute-neg-frac87.7%
distribute-neg-frac287.7%
neg-sub087.7%
sub-neg87.7%
+-commutative87.7%
associate--r+87.7%
neg-sub087.7%
remove-double-neg87.7%
Simplified87.7%
Taylor expanded in y around 0 89.3%
associate-/l*89.2%
Simplified89.2%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e+118) (not (<= z 1.25e+54))) (+ x y) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e+118) || !(z <= 1.25e+54)) {
tmp = x + y;
} 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 <= (-1.2d+118)) .or. (.not. (z <= 1.25d+54))) then
tmp = x + y
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 <= -1.2e+118) || !(z <= 1.25e+54)) {
tmp = x + y;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e+118) or not (z <= 1.25e+54): tmp = x + y else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e+118) || !(z <= 1.25e+54)) tmp = Float64(x + y); 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 <= -1.2e+118) || ~((z <= 1.25e+54))) tmp = x + y; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e+118], N[Not[LessEqual[z, 1.25e+54]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+118} \lor \neg \left(z \leq 1.25 \cdot 10^{+54}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.2e118 or 1.25000000000000001e54 < z Initial program 99.9%
Taylor expanded in z around inf 90.2%
+-commutative90.2%
Simplified90.2%
if -1.2e118 < z < 1.25000000000000001e54Initial program 96.1%
Taylor expanded in t around inf 88.0%
associate-*r/88.0%
mul-1-neg88.0%
distribute-lft-neg-out88.0%
*-commutative88.0%
*-lft-identity88.0%
times-frac86.5%
/-rgt-identity86.5%
distribute-neg-frac86.5%
distribute-neg-frac286.5%
neg-sub086.5%
sub-neg86.5%
+-commutative86.5%
associate--r+86.5%
neg-sub086.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in y around 0 88.0%
associate-/l*87.9%
Simplified87.9%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e-51) (not (<= z 2.3e-53))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e-51) || !(z <= 2.3e-53)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-7.5d-51)) .or. (.not. (z <= 2.3d-53))) then
tmp = x + y
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e-51) || !(z <= 2.3e-53)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e-51) or not (z <= 2.3e-53): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e-51) || !(z <= 2.3e-53)) 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 <= -7.5e-51) || ~((z <= 2.3e-53))) tmp = x + y; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e-51], N[Not[LessEqual[z, 2.3e-53]], $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 -7.5 \cdot 10^{-51} \lor \neg \left(z \leq 2.3 \cdot 10^{-53}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -7.49999999999999976e-51 or 2.3000000000000001e-53 < z Initial program 99.9%
Taylor expanded in z around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -7.49999999999999976e-51 < z < 2.3000000000000001e-53Initial program 94.5%
Taylor expanded in z around 0 76.9%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.1e-51) (not (<= z 2.3e-53))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.1e-51) || !(z <= 2.3e-53)) {
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 <= (-5.1d-51)) .or. (.not. (z <= 2.3d-53))) 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 <= -5.1e-51) || !(z <= 2.3e-53)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.1e-51) or not (z <= 2.3e-53): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.1e-51) || !(z <= 2.3e-53)) 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 <= -5.1e-51) || ~((z <= 2.3e-53))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.1e-51], N[Not[LessEqual[z, 2.3e-53]], $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 -5.1 \cdot 10^{-51} \lor \neg \left(z \leq 2.3 \cdot 10^{-53}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5.0999999999999997e-51 or 2.3000000000000001e-53 < z Initial program 99.9%
Taylor expanded in z around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -5.0999999999999997e-51 < z < 2.3000000000000001e-53Initial program 94.5%
Taylor expanded in z around 0 75.9%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e-68) (not (<= z 8.2e-20))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.6e-68) || !(z <= 8.2e-20)) {
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 <= (-4.6d-68)) .or. (.not. (z <= 8.2d-20))) 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 <= -4.6e-68) || !(z <= 8.2e-20)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.6e-68) or not (z <= 8.2e-20): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.6e-68) || !(z <= 8.2e-20)) 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 <= -4.6e-68) || ~((z <= 8.2e-20))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.6e-68], N[Not[LessEqual[z, 8.2e-20]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-68} \lor \neg \left(z \leq 8.2 \cdot 10^{-20}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.59999999999999994e-68 or 8.2000000000000002e-20 < z Initial program 99.9%
Taylor expanded in z around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -4.59999999999999994e-68 < z < 8.2000000000000002e-20Initial program 94.5%
Taylor expanded in x around inf 53.1%
Final simplification68.1%
(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.5%
Taylor expanded in x around inf 53.1%
(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 2024180
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))