
(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 98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y t) a)))
(if (<= z -8e-58)
(+ x y)
(if (<= z 3.5e-276)
t_1
(if (<= z 8.4e-125) x (if (<= z 2.9e-47) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / a;
double tmp;
if (z <= -8e-58) {
tmp = x + y;
} else if (z <= 3.5e-276) {
tmp = t_1;
} else if (z <= 8.4e-125) {
tmp = x;
} else if (z <= 2.9e-47) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y * t) / a
if (z <= (-8d-58)) then
tmp = x + y
else if (z <= 3.5d-276) then
tmp = t_1
else if (z <= 8.4d-125) then
tmp = x
else if (z <= 2.9d-47) then
tmp = t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / a;
double tmp;
if (z <= -8e-58) {
tmp = x + y;
} else if (z <= 3.5e-276) {
tmp = t_1;
} else if (z <= 8.4e-125) {
tmp = x;
} else if (z <= 2.9e-47) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * t) / a tmp = 0 if z <= -8e-58: tmp = x + y elif z <= 3.5e-276: tmp = t_1 elif z <= 8.4e-125: tmp = x elif z <= 2.9e-47: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * t) / a) tmp = 0.0 if (z <= -8e-58) tmp = Float64(x + y); elseif (z <= 3.5e-276) tmp = t_1; elseif (z <= 8.4e-125) tmp = x; elseif (z <= 2.9e-47) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * t) / a; tmp = 0.0; if (z <= -8e-58) tmp = x + y; elseif (z <= 3.5e-276) tmp = t_1; elseif (z <= 8.4e-125) tmp = x; elseif (z <= 2.9e-47) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -8e-58], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.5e-276], t$95$1, If[LessEqual[z, 8.4e-125], x, If[LessEqual[z, 2.9e-47], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot t}{a}\\
\mathbf{if}\;z \leq -8 \cdot 10^{-58}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-276}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{-125}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -8.0000000000000002e-58 or 2.9e-47 < z Initial program 99.8%
Taylor expanded in z around inf 70.5%
+-commutative70.5%
Simplified70.5%
if -8.0000000000000002e-58 < z < 3.49999999999999993e-276 or 8.3999999999999999e-125 < z < 2.9e-47Initial program 95.3%
clear-num95.2%
un-div-inv95.2%
Applied egg-rr95.2%
Taylor expanded in a around inf 80.1%
mul-1-neg80.1%
unsub-neg80.1%
associate-/l*82.4%
Simplified82.4%
Taylor expanded in y around inf 56.6%
sub-neg56.6%
distribute-lft-in55.4%
associate-/l*52.0%
*-commutative52.0%
associate-*r/50.9%
distribute-rgt-neg-out50.9%
sub-neg50.9%
associate-*r/52.0%
associate-*r/52.0%
*-commutative52.0%
*-commutative52.0%
div-sub53.2%
cancel-sign-sub-inv53.2%
*-commutative53.2%
distribute-rgt-in53.2%
+-commutative53.2%
+-commutative53.2%
unsub-neg53.2%
Simplified53.2%
Taylor expanded in t around inf 52.8%
if 3.49999999999999993e-276 < z < 8.3999999999999999e-125Initial program 96.9%
Taylor expanded in x around inf 59.2%
Final simplification63.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e-9) (not (<= z 6.2e+139))) (+ x (/ y (/ z (- z t)))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e-9) || !(z <= 6.2e+139)) {
tmp = x + (y / (z / (z - t)));
} 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 <= (-8.2d-9)) .or. (.not. (z <= 6.2d+139))) then
tmp = x + (y / (z / (z - t)))
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 <= -8.2e-9) || !(z <= 6.2e+139)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e-9) or not (z <= 6.2e+139): tmp = x + (y / (z / (z - t))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e-9) || !(z <= 6.2e+139)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); 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 <= -8.2e-9) || ~((z <= 6.2e+139))) tmp = x + (y / (z / (z - t))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e-9], N[Not[LessEqual[z, 6.2e+139]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $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 -8.2 \cdot 10^{-9} \lor \neg \left(z \leq 6.2 \cdot 10^{+139}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -8.2000000000000006e-9 or 6.2e139 < z Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 91.5%
if -8.2000000000000006e-9 < z < 6.2e139Initial program 96.9%
Taylor expanded in t around inf 83.7%
associate-*r/83.7%
mul-1-neg83.7%
distribute-lft-neg-out83.7%
*-commutative83.7%
*-lft-identity83.7%
times-frac87.1%
/-rgt-identity87.1%
distribute-neg-frac87.1%
distribute-neg-frac287.1%
neg-sub087.1%
sub-neg87.1%
+-commutative87.1%
associate--r+87.1%
neg-sub087.1%
remove-double-neg87.1%
Simplified87.1%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e-9) (not (<= z 5.3e+123))) (+ 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 <= -9e-9) || !(z <= 5.3e+123)) {
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 <= (-9d-9)) .or. (.not. (z <= 5.3d+123))) 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 <= -9e-9) || !(z <= 5.3e+123)) {
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 <= -9e-9) or not (z <= 5.3e+123): 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 <= -9e-9) || !(z <= 5.3e+123)) 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 <= -9e-9) || ~((z <= 5.3e+123))) 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, -9e-9], N[Not[LessEqual[z, 5.3e+123]], $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 -9 \cdot 10^{-9} \lor \neg \left(z \leq 5.3 \cdot 10^{+123}\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 < -8.99999999999999953e-9 or 5.3e123 < z Initial program 99.9%
Taylor expanded in a around 0 68.9%
associate-/l*91.7%
div-sub91.7%
*-inverses91.7%
Simplified91.7%
if -8.99999999999999953e-9 < z < 5.3e123Initial program 96.9%
Taylor expanded in t around inf 84.5%
associate-*r/84.5%
mul-1-neg84.5%
distribute-lft-neg-out84.5%
*-commutative84.5%
*-lft-identity84.5%
times-frac86.8%
/-rgt-identity86.8%
distribute-neg-frac86.8%
distribute-neg-frac286.8%
neg-sub086.8%
sub-neg86.8%
+-commutative86.8%
associate--r+86.8%
neg-sub086.8%
remove-double-neg86.8%
Simplified86.8%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e-20) (not (<= z 9.2e-47))) (+ 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 <= -4.3e-20) || !(z <= 9.2e-47)) {
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 <= (-4.3d-20)) .or. (.not. (z <= 9.2d-47))) 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 <= -4.3e-20) || !(z <= 9.2e-47)) {
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 <= -4.3e-20) or not (z <= 9.2e-47): 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 <= -4.3e-20) || !(z <= 9.2e-47)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -4.3e-20) || ~((z <= 9.2e-47))) 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, -4.3e-20], N[Not[LessEqual[z, 9.2e-47]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-20} \lor \neg \left(z \leq 9.2 \cdot 10^{-47}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.30000000000000011e-20 or 9.19999999999999928e-47 < z Initial program 99.8%
Taylor expanded in a around 0 68.8%
associate-/l*85.8%
div-sub85.8%
*-inverses85.8%
Simplified85.8%
if -4.30000000000000011e-20 < z < 9.19999999999999928e-47Initial program 96.0%
Taylor expanded in z around 0 80.4%
Final simplification83.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.6e-9) (+ x (/ y (/ z (- z t)))) (if (<= z 3e+105) (+ x (* y (/ t (- a z)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-9) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 3e+105) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.6d-9)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 3d+105) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-9) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 3e+105) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.6e-9: tmp = x + (y / (z / (z - t))) elif z <= 3e+105: tmp = x + (y * (t / (a - z))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e-9) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 3e+105) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.6e-9) tmp = x + (y / (z / (z - t))); elseif (z <= 3e+105) tmp = x + (y * (t / (a - z))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e-9], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+105], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+105}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if z < -3.6e-9Initial program 99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 90.1%
if -3.6e-9 < z < 3.0000000000000001e105Initial program 96.8%
Taylor expanded in t around inf 85.2%
associate-*r/85.2%
mul-1-neg85.2%
distribute-lft-neg-out85.2%
*-commutative85.2%
*-lft-identity85.2%
times-frac87.6%
/-rgt-identity87.6%
distribute-neg-frac87.6%
distribute-neg-frac287.6%
neg-sub087.6%
sub-neg87.6%
+-commutative87.6%
associate--r+87.6%
neg-sub087.6%
remove-double-neg87.6%
Simplified87.6%
if 3.0000000000000001e105 < z Initial program 100.0%
Taylor expanded in t around 0 61.6%
+-commutative61.6%
associate-/l*91.5%
Simplified91.5%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e-19) (not (<= z 8.4e+27))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e-19) || !(z <= 8.4e+27)) {
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 <= (-9.5d-19)) .or. (.not. (z <= 8.4d+27))) 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 <= -9.5e-19) || !(z <= 8.4e+27)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e-19) or not (z <= 8.4e+27): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e-19) || !(z <= 8.4e+27)) 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 <= -9.5e-19) || ~((z <= 8.4e+27))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e-19], N[Not[LessEqual[z, 8.4e+27]], $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 -9.5 \cdot 10^{-19} \lor \neg \left(z \leq 8.4 \cdot 10^{+27}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -9.4999999999999995e-19 or 8.39999999999999978e27 < z Initial program 99.8%
Taylor expanded in z around inf 72.5%
+-commutative72.5%
Simplified72.5%
if -9.4999999999999995e-19 < z < 8.39999999999999978e27Initial program 96.2%
Taylor expanded in z around 0 77.7%
Final simplification75.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.7e+79) (not (<= y 6.4e+124))) (* y (- 1.0 (/ t z))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.7e+79) || !(y <= 6.4e+124)) {
tmp = y * (1.0 - (t / 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 ((y <= (-3.7d+79)) .or. (.not. (y <= 6.4d+124))) then
tmp = y * (1.0d0 - (t / 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 ((y <= -3.7e+79) || !(y <= 6.4e+124)) {
tmp = y * (1.0 - (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.7e+79) or not (y <= 6.4e+124): tmp = y * (1.0 - (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.7e+79) || !(y <= 6.4e+124)) tmp = Float64(y * Float64(1.0 - Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.7e+79) || ~((y <= 6.4e+124))) tmp = y * (1.0 - (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.7e+79], N[Not[LessEqual[y, 6.4e+124]], $MachinePrecision]], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+79} \lor \neg \left(y \leq 6.4 \cdot 10^{+124}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -3.70000000000000009e79 or 6.39999999999999986e124 < y Initial program 99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 42.0%
+-commutative42.0%
associate-/l*63.0%
div-sub63.0%
*-inverses63.0%
Simplified63.0%
Taylor expanded in y around inf 55.7%
if -3.70000000000000009e79 < y < 6.39999999999999986e124Initial program 97.0%
Taylor expanded in z around inf 64.5%
+-commutative64.5%
Simplified64.5%
Final simplification61.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -5e+198) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5e+198) {
tmp = x;
} 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 (a <= (-5d+198)) then
tmp = x
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 (a <= -5e+198) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5e+198: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5e+198) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5e+198) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5e+198], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+198}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -5.00000000000000049e198Initial program 99.8%
Taylor expanded in x around inf 73.3%
if -5.00000000000000049e198 < a Initial program 97.9%
Taylor expanded in z around inf 54.6%
+-commutative54.6%
Simplified54.6%
Final simplification55.9%
(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 42.8%
(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 2024172
(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)))))