
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 98.5%
clear-num98.4%
un-div-inv99.0%
Applied egg-rr99.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.7e+53)
(+ x y)
(if (<= t 3.8e-22)
(+ x (* y (/ z a)))
(if (<= t 1.42e+113) (- x (/ (* y z) t)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.7e+53) {
tmp = x + y;
} else if (t <= 3.8e-22) {
tmp = x + (y * (z / a));
} else if (t <= 1.42e+113) {
tmp = x - ((y * z) / t);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.7d+53)) then
tmp = x + y
else if (t <= 3.8d-22) then
tmp = x + (y * (z / a))
else if (t <= 1.42d+113) then
tmp = x - ((y * z) / t)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.7e+53) {
tmp = x + y;
} else if (t <= 3.8e-22) {
tmp = x + (y * (z / a));
} else if (t <= 1.42e+113) {
tmp = x - ((y * z) / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.7e+53: tmp = x + y elif t <= 3.8e-22: tmp = x + (y * (z / a)) elif t <= 1.42e+113: tmp = x - ((y * z) / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.7e+53) tmp = Float64(x + y); elseif (t <= 3.8e-22) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (t <= 1.42e+113) tmp = Float64(x - Float64(Float64(y * z) / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.7e+53) tmp = x + y; elseif (t <= 3.8e-22) tmp = x + (y * (z / a)); elseif (t <= 1.42e+113) tmp = x - ((y * z) / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.7e+53], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.8e-22], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.42e+113], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+53}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-22}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 1.42 \cdot 10^{+113}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.7e53 or 1.42e113 < t Initial program 100.0%
Taylor expanded in t around inf 84.9%
+-commutative84.9%
Simplified84.9%
if -3.7e53 < t < 3.80000000000000023e-22Initial program 96.7%
Taylor expanded in t around 0 72.5%
+-commutative72.5%
associate-/l*77.2%
Simplified77.2%
if 3.80000000000000023e-22 < t < 1.42e113Initial program 99.9%
Taylor expanded in z around inf 79.8%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*76.9%
Simplified76.9%
associate-*r/76.9%
add-sqr-sqrt38.5%
sqrt-unprod53.4%
sqr-neg53.4%
sqrt-unprod24.6%
add-sqr-sqrt49.0%
*-commutative49.0%
add-sqr-sqrt24.6%
sqrt-unprod53.4%
sqr-neg53.4%
sqrt-unprod38.5%
add-sqr-sqrt76.9%
Applied egg-rr76.9%
Final simplification80.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.3e+53)
(+ x y)
(if (<= t 2.55e-23)
(+ x (* y (/ z a)))
(if (<= t 1.55e+113) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.3e+53) {
tmp = x + y;
} else if (t <= 2.55e-23) {
tmp = x + (y * (z / a));
} else if (t <= 1.55e+113) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.3d+53)) then
tmp = x + y
else if (t <= 2.55d-23) then
tmp = x + (y * (z / a))
else if (t <= 1.55d+113) then
tmp = x - (y * (z / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.3e+53) {
tmp = x + y;
} else if (t <= 2.55e-23) {
tmp = x + (y * (z / a));
} else if (t <= 1.55e+113) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.3e+53: tmp = x + y elif t <= 2.55e-23: tmp = x + (y * (z / a)) elif t <= 1.55e+113: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.3e+53) tmp = Float64(x + y); elseif (t <= 2.55e-23) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (t <= 1.55e+113) tmp = Float64(x - Float64(y * Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.3e+53) tmp = x + y; elseif (t <= 2.55e-23) tmp = x + (y * (z / a)); elseif (t <= 1.55e+113) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.3e+53], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.55e-23], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e+113], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+53}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-23}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+113}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.3000000000000002e53 or 1.54999999999999996e113 < t Initial program 100.0%
Taylor expanded in t around inf 84.9%
+-commutative84.9%
Simplified84.9%
if -3.3000000000000002e53 < t < 2.55000000000000005e-23Initial program 96.7%
Taylor expanded in t around 0 72.5%
+-commutative72.5%
associate-/l*77.2%
Simplified77.2%
if 2.55000000000000005e-23 < t < 1.54999999999999996e113Initial program 99.9%
Taylor expanded in z around inf 79.8%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*76.9%
Simplified76.9%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.8e+83) (not (<= t 8.5e+71))) (+ x (* y (/ t (- t a)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.8e+83) || !(t <= 8.5e+71)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y / ((a - t) / 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 <= (-7.8d+83)) .or. (.not. (t <= 8.5d+71))) then
tmp = x + (y * (t / (t - a)))
else
tmp = x + (y / ((a - t) / 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 <= -7.8e+83) || !(t <= 8.5e+71)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.8e+83) or not (t <= 8.5e+71): tmp = x + (y * (t / (t - a))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.8e+83) || !(t <= 8.5e+71)) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.8e+83) || ~((t <= 8.5e+71))) tmp = x + (y * (t / (t - a))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.8e+83], N[Not[LessEqual[t, 8.5e+71]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+83} \lor \neg \left(t \leq 8.5 \cdot 10^{+71}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -7.8000000000000003e83 or 8.4999999999999996e71 < t Initial program 100.0%
Taylor expanded in z around 0 66.0%
+-commutative66.0%
associate-*r/66.0%
mul-1-neg66.0%
distribute-lft-neg-out66.0%
*-commutative66.0%
*-lft-identity66.0%
times-frac92.7%
/-rgt-identity92.7%
distribute-neg-frac92.7%
distribute-neg-frac292.7%
neg-sub092.7%
sub-neg92.7%
+-commutative92.7%
associate--r+92.7%
neg-sub092.7%
remove-double-neg92.7%
Simplified92.7%
if -7.8000000000000003e83 < t < 8.4999999999999996e71Initial program 97.2%
clear-num97.0%
un-div-inv98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 88.8%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.7e+84) (not (<= t 2.95e+113))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.7e+84) || !(t <= 2.95e+113)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / 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 <= (-6.7d+84)) .or. (.not. (t <= 2.95d+113))) then
tmp = x + y
else
tmp = x + (y / ((a - t) / 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 <= -6.7e+84) || !(t <= 2.95e+113)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.7e+84) or not (t <= 2.95e+113): tmp = x + y else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.7e+84) || !(t <= 2.95e+113)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.7e+84) || ~((t <= 2.95e+113))) tmp = x + y; else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.7e+84], N[Not[LessEqual[t, 2.95e+113]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.7 \cdot 10^{+84} \lor \neg \left(t \leq 2.95 \cdot 10^{+113}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -6.70000000000000041e84 or 2.95000000000000011e113 < t Initial program 100.0%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -6.70000000000000041e84 < t < 2.95000000000000011e113Initial program 97.4%
clear-num97.2%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 87.1%
Final simplification86.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.8e+45) (- x (* y (+ (/ z t) -1.0))) (if (<= t 1.12e+74) (+ x (/ y (/ (- a t) z))) (+ x (* y (/ t (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e+45) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 1.12e+74) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.8d+45)) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else if (t <= 1.12d+74) then
tmp = x + (y / ((a - t) / z))
else
tmp = x + (y * (t / (t - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e+45) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 1.12e+74) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.8e+45: tmp = x - (y * ((z / t) + -1.0)) elif t <= 1.12e+74: tmp = x + (y / ((a - t) / z)) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8e+45) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); elseif (t <= 1.12e+74) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.8e+45) tmp = x - (y * ((z / t) + -1.0)); elseif (t <= 1.12e+74) tmp = x + (y / ((a - t) / z)); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8e+45], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+74], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+45}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+74}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if t < -2.7999999999999999e45Initial program 100.0%
Taylor expanded in a around 0 74.0%
mul-1-neg74.0%
unsub-neg74.0%
associate-/l*95.2%
div-sub95.2%
sub-neg95.2%
*-inverses95.2%
metadata-eval95.2%
Simplified95.2%
if -2.7999999999999999e45 < t < 1.12000000000000003e74Initial program 97.0%
clear-num96.7%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 89.3%
if 1.12000000000000003e74 < t Initial program 100.0%
Taylor expanded in z around 0 61.2%
+-commutative61.2%
associate-*r/61.2%
mul-1-neg61.2%
distribute-lft-neg-out61.2%
*-commutative61.2%
*-lft-identity61.2%
times-frac90.6%
/-rgt-identity90.6%
distribute-neg-frac90.6%
distribute-neg-frac290.6%
neg-sub090.6%
sub-neg90.6%
+-commutative90.6%
associate--r+90.6%
neg-sub090.6%
remove-double-neg90.6%
Simplified90.6%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.06e+55) (not (<= t 2.6e-151))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.06e+55) || !(t <= 2.6e-151)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.06d+55)) .or. (.not. (t <= 2.6d-151))) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.06e+55) || !(t <= 2.6e-151)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.06e+55) or not (t <= 2.6e-151): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.06e+55) || !(t <= 2.6e-151)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.06e+55) || ~((t <= 2.6e-151))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.06e+55], N[Not[LessEqual[t, 2.6e-151]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.06 \cdot 10^{+55} \lor \neg \left(t \leq 2.6 \cdot 10^{-151}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.06000000000000004e55 or 2.6e-151 < t Initial program 98.2%
Taylor expanded in t around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -1.06000000000000004e55 < t < 2.6e-151Initial program 99.1%
Taylor expanded in t around 0 76.8%
+-commutative76.8%
associate-/l*82.6%
Simplified82.6%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.45e+54) (not (<= t 2.65e-151))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e+54) || !(t <= 2.65e-151)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.45d+54)) .or. (.not. (t <= 2.65d-151))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e+54) || !(t <= 2.65e-151)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.45e+54) or not (t <= 2.65e-151): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.45e+54) || !(t <= 2.65e-151)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.45e+54) || ~((t <= 2.65e-151))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e+54], N[Not[LessEqual[t, 2.65e-151]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+54} \lor \neg \left(t \leq 2.65 \cdot 10^{-151}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.4499999999999999e54 or 2.64999999999999989e-151 < t Initial program 98.2%
Taylor expanded in t around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -1.4499999999999999e54 < t < 2.64999999999999989e-151Initial program 99.1%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in t around 0 82.2%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 98.5%
(FPCore (x y z t a) :precision binary64 (if (<= a 6.4e+115) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 6.4e+115) {
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 <= 6.4d+115) 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 <= 6.4e+115) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 6.4e+115: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 6.4e+115) 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 <= 6.4e+115) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 6.4e+115], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.4 \cdot 10^{+115}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 6.4e115Initial program 98.3%
Taylor expanded in t around inf 68.7%
+-commutative68.7%
Simplified68.7%
if 6.4e115 < a Initial program 99.9%
Taylor expanded in x around inf 68.2%
Final simplification68.6%
(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.5%
Taylor expanded in x around inf 53.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024136
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))