
(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 11 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) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x - (y / ((z - a) / (t - z)));
}
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) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y / ((z - a) / (t - z)));
}
def code(x, y, z, t, a): return x - (y / ((z - a) / (t - z)))
function code(x, y, z, t, a) return Float64(x - Float64(y / Float64(Float64(z - a) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y / ((z - a) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{\frac{z - a}{t - z}}
\end{array}
Initial program 98.0%
clear-num97.6%
un-div-inv98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a z))) (t_2 (+ x (* y (- 1.0 (/ t z))))))
(if (<= z -1.28e+54)
t_2
(if (<= z 4.6e-15)
(+ x (* t t_1))
(if (<= z 2e+109) (- x (* z t_1)) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - z);
double t_2 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -1.28e+54) {
tmp = t_2;
} else if (z <= 4.6e-15) {
tmp = x + (t * t_1);
} else if (z <= 2e+109) {
tmp = x - (z * t_1);
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = y / (a - z)
t_2 = x + (y * (1.0d0 - (t / z)))
if (z <= (-1.28d+54)) then
tmp = t_2
else if (z <= 4.6d-15) then
tmp = x + (t * t_1)
else if (z <= 2d+109) then
tmp = x - (z * t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - z);
double t_2 = x + (y * (1.0 - (t / z)));
double tmp;
if (z <= -1.28e+54) {
tmp = t_2;
} else if (z <= 4.6e-15) {
tmp = x + (t * t_1);
} else if (z <= 2e+109) {
tmp = x - (z * t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - z) t_2 = x + (y * (1.0 - (t / z))) tmp = 0 if z <= -1.28e+54: tmp = t_2 elif z <= 4.6e-15: tmp = x + (t * t_1) elif z <= 2e+109: tmp = x - (z * t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - z)) t_2 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))) tmp = 0.0 if (z <= -1.28e+54) tmp = t_2; elseif (z <= 4.6e-15) tmp = Float64(x + Float64(t * t_1)); elseif (z <= 2e+109) tmp = Float64(x - Float64(z * t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - z); t_2 = x + (y * (1.0 - (t / z))); tmp = 0.0; if (z <= -1.28e+54) tmp = t_2; elseif (z <= 4.6e-15) tmp = x + (t * t_1); elseif (z <= 2e+109) tmp = x - (z * t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.28e+54], t$95$2, If[LessEqual[z, 4.6e-15], N[(x + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+109], N[(x - N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - z}\\
t_2 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.28 \cdot 10^{+54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-15}:\\
\;\;\;\;x + t \cdot t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+109}:\\
\;\;\;\;x - z \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.28e54 or 1.99999999999999996e109 < z Initial program 99.9%
Taylor expanded in a around 0 65.0%
associate-/l*92.7%
div-sub92.7%
*-inverses92.7%
Simplified92.7%
if -1.28e54 < z < 4.59999999999999981e-15Initial program 96.2%
Taylor expanded in t around inf 92.0%
mul-1-neg92.0%
associate-/l*92.7%
Simplified92.7%
if 4.59999999999999981e-15 < z < 1.99999999999999996e109Initial program 100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Final simplification93.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (- 1.0 (/ t z))))))
(if (<= z -3.8e+54)
t_1
(if (<= z 1.95e-14)
(+ x (/ (* y t) (- a z)))
(if (<= z 3.2e+108) (- x (* z (/ 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.8e+54) {
tmp = t_1;
} else if (z <= 1.95e-14) {
tmp = x + ((y * t) / (a - z));
} else if (z <= 3.2e+108) {
tmp = x - (z * (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.8d+54)) then
tmp = t_1
else if (z <= 1.95d-14) then
tmp = x + ((y * t) / (a - z))
else if (z <= 3.2d+108) then
tmp = x - (z * (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.8e+54) {
tmp = t_1;
} else if (z <= 1.95e-14) {
tmp = x + ((y * t) / (a - z));
} else if (z <= 3.2e+108) {
tmp = x - (z * (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.8e+54: tmp = t_1 elif z <= 1.95e-14: tmp = x + ((y * t) / (a - z)) elif z <= 3.2e+108: tmp = x - (z * (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.8e+54) tmp = t_1; elseif (z <= 1.95e-14) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); elseif (z <= 3.2e+108) tmp = Float64(x - Float64(z * 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.8e+54) tmp = t_1; elseif (z <= 1.95e-14) tmp = x + ((y * t) / (a - z)); elseif (z <= 3.2e+108) tmp = x - (z * (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.8e+54], t$95$1, If[LessEqual[z, 1.95e-14], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+108], N[(x - N[(z * 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.8 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-14}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+108}:\\
\;\;\;\;x - z \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.8000000000000002e54 or 3.1999999999999999e108 < z Initial program 99.9%
Taylor expanded in a around 0 65.0%
associate-/l*92.7%
div-sub92.7%
*-inverses92.7%
Simplified92.7%
if -3.8000000000000002e54 < z < 1.9499999999999999e-14Initial program 96.2%
Taylor expanded in t around inf 92.0%
associate-*r/92.0%
mul-1-neg92.0%
distribute-lft-neg-out92.0%
*-commutative92.0%
*-lft-identity92.0%
times-frac90.5%
/-rgt-identity90.5%
distribute-neg-frac90.5%
distribute-neg-frac290.5%
neg-sub090.5%
sub-neg90.5%
+-commutative90.5%
associate--r+90.5%
neg-sub090.5%
remove-double-neg90.5%
Simplified90.5%
associate-*r/92.0%
Applied egg-rr92.0%
if 1.9499999999999999e-14 < z < 3.1999999999999999e108Initial program 100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Final simplification93.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (- 1.0 (/ t z))))))
(if (<= z -6e+56)
t_1
(if (<= z 2e-14)
(+ x (* y (/ t (- a z))))
(if (<= z 1.3e+109) (- x (* z (/ 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 <= -6e+56) {
tmp = t_1;
} else if (z <= 2e-14) {
tmp = x + (y * (t / (a - z)));
} else if (z <= 1.3e+109) {
tmp = x - (z * (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 <= (-6d+56)) then
tmp = t_1
else if (z <= 2d-14) then
tmp = x + (y * (t / (a - z)))
else if (z <= 1.3d+109) then
tmp = x - (z * (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 <= -6e+56) {
tmp = t_1;
} else if (z <= 2e-14) {
tmp = x + (y * (t / (a - z)));
} else if (z <= 1.3e+109) {
tmp = x - (z * (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 <= -6e+56: tmp = t_1 elif z <= 2e-14: tmp = x + (y * (t / (a - z))) elif z <= 1.3e+109: tmp = x - (z * (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 <= -6e+56) tmp = t_1; elseif (z <= 2e-14) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); elseif (z <= 1.3e+109) tmp = Float64(x - Float64(z * 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 <= -6e+56) tmp = t_1; elseif (z <= 2e-14) tmp = x + (y * (t / (a - z))); elseif (z <= 1.3e+109) tmp = x - (z * (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, -6e+56], t$95$1, If[LessEqual[z, 2e-14], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+109], N[(x - N[(z * 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 -6 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-14}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+109}:\\
\;\;\;\;x - z \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.00000000000000012e56 or 1.2999999999999999e109 < z Initial program 99.9%
Taylor expanded in a around 0 65.0%
associate-/l*92.7%
div-sub92.7%
*-inverses92.7%
Simplified92.7%
if -6.00000000000000012e56 < z < 2e-14Initial program 96.2%
Taylor expanded in t around inf 92.0%
associate-*r/92.0%
mul-1-neg92.0%
distribute-lft-neg-out92.0%
*-commutative92.0%
*-lft-identity92.0%
times-frac90.5%
/-rgt-identity90.5%
distribute-neg-frac90.5%
distribute-neg-frac290.5%
neg-sub090.5%
sub-neg90.5%
+-commutative90.5%
associate--r+90.5%
neg-sub090.5%
remove-double-neg90.5%
Simplified90.5%
if 2e-14 < z < 1.2999999999999999e109Initial program 100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Final simplification92.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.25e+55) (not (<= z 1.08e+49))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.25e+55) || !(z <= 1.08e+49)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.25d+55)) .or. (.not. (z <= 1.08d+49))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y * (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.25e+55) || !(z <= 1.08e+49)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.25e+55) or not (z <= 1.08e+49): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.25e+55) || !(z <= 1.08e+49)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.25e+55) || ~((z <= 1.08e+49))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.25e+55], N[Not[LessEqual[z, 1.08e+49]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+55} \lor \neg \left(z \leq 1.08 \cdot 10^{+49}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -2.24999999999999999e55 or 1.08000000000000001e49 < z Initial program 99.9%
Taylor expanded in a around 0 67.1%
associate-/l*91.3%
div-sub91.3%
*-inverses91.3%
Simplified91.3%
if -2.24999999999999999e55 < z < 1.08000000000000001e49Initial program 96.6%
Taylor expanded in t around inf 91.3%
associate-*r/91.3%
mul-1-neg91.3%
distribute-lft-neg-out91.3%
*-commutative91.3%
*-lft-identity91.3%
times-frac89.9%
/-rgt-identity89.9%
distribute-neg-frac89.9%
distribute-neg-frac289.9%
neg-sub089.9%
sub-neg89.9%
+-commutative89.9%
associate--r+89.9%
neg-sub089.9%
remove-double-neg89.9%
Simplified89.9%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e+15) (not (<= z 2.4e-17))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e+15) || !(z <= 2.4e-17)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.2d+15)) .or. (.not. (z <= 2.4d-17))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e+15) || !(z <= 2.4e-17)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e+15) or not (z <= 2.4e-17): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e+15) || !(z <= 2.4e-17)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.2e+15) || ~((z <= 2.4e-17))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e+15], N[Not[LessEqual[z, 2.4e-17]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+15} \lor \neg \left(z \leq 2.4 \cdot 10^{-17}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.2e15 or 2.39999999999999986e-17 < z Initial program 99.9%
Taylor expanded in a around 0 70.3%
associate-/l*89.4%
div-sub89.4%
*-inverses89.4%
Simplified89.4%
if -1.2e15 < z < 2.39999999999999986e-17Initial program 95.9%
Taylor expanded in z around 0 83.8%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e-30) (not (<= z 7.4e-25))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-30) || !(z <= 7.4e-25)) {
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.2d-30)) .or. (.not. (z <= 7.4d-25))) 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.2e-30) || !(z <= 7.4e-25)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e-30) or not (z <= 7.4e-25): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e-30) || !(z <= 7.4e-25)) 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.2e-30) || ~((z <= 7.4e-25))) 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.2e-30], N[Not[LessEqual[z, 7.4e-25]], $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.2 \cdot 10^{-30} \lor \neg \left(z \leq 7.4 \cdot 10^{-25}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -7.2000000000000006e-30 or 7.40000000000000017e-25 < z Initial program 99.9%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -7.2000000000000006e-30 < z < 7.40000000000000017e-25Initial program 95.5%
Taylor expanded in z around 0 85.0%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.9e-30) (not (<= z 1.02e-19))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.9e-30) || !(z <= 1.02e-19)) {
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 <= (-5.9d-30)) .or. (.not. (z <= 1.02d-19))) 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 <= -5.9e-30) || !(z <= 1.02e-19)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.9e-30) or not (z <= 1.02e-19): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.9e-30) || !(z <= 1.02e-19)) 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 <= -5.9e-30) || ~((z <= 1.02e-19))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.9e-30], N[Not[LessEqual[z, 1.02e-19]], $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 -5.9 \cdot 10^{-30} \lor \neg \left(z \leq 1.02 \cdot 10^{-19}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -5.89999999999999979e-30 or 1.02000000000000004e-19 < z Initial program 99.9%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -5.89999999999999979e-30 < z < 1.02000000000000004e-19Initial program 95.5%
clear-num94.7%
un-div-inv95.6%
Applied egg-rr95.6%
Taylor expanded in z around 0 82.4%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e-9) (not (<= z 1.5e+46))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e-9) || !(z <= 1.5e+46)) {
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 <= (-9.2d-9)) .or. (.not. (z <= 1.5d+46))) 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 <= -9.2e-9) || !(z <= 1.5e+46)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e-9) or not (z <= 1.5e+46): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e-9) || !(z <= 1.5e+46)) 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 <= -9.2e-9) || ~((z <= 1.5e+46))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e-9], N[Not[LessEqual[z, 1.5e+46]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{-9} \lor \neg \left(z \leq 1.5 \cdot 10^{+46}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.1999999999999997e-9 or 1.50000000000000012e46 < z Initial program 99.9%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -9.1999999999999997e-9 < z < 1.50000000000000012e46Initial program 96.3%
Taylor expanded in x around inf 64.7%
Final simplification71.5%
(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 98.0%
(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 98.0%
Taylor expanded in x around inf 55.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 2024177
(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)))))