
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (- z y) (/ (- z a) t))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - y) / ((z - 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 + ((z - y) / ((z - a) / t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - y) / ((z - a) / t));
}
def code(x, y, z, t, a): return x + ((z - y) / ((z - a) / t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - y) / Float64(Float64(z - a) / t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - y) / ((z - a) / t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - y}{\frac{z - a}{t}}
\end{array}
Initial program 86.0%
associate-/l*96.5%
Simplified96.5%
clear-num96.4%
un-div-inv96.8%
Applied egg-rr96.8%
Final simplification96.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (/ y z)))))
(if (<= z -3.7e+87)
(+ x t)
(if (<= z -7500000.0)
t_1
(if (<= z 5.6e-53)
(+ x (* y (/ t a)))
(if (<= z 5.4e+44) t_1 (+ x t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / z));
double tmp;
if (z <= -3.7e+87) {
tmp = x + t;
} else if (z <= -7500000.0) {
tmp = t_1;
} else if (z <= 5.6e-53) {
tmp = x + (y * (t / a));
} else if (z <= 5.4e+44) {
tmp = t_1;
} else {
tmp = x + 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) :: t_1
real(8) :: tmp
t_1 = x - (t * (y / z))
if (z <= (-3.7d+87)) then
tmp = x + t
else if (z <= (-7500000.0d0)) then
tmp = t_1
else if (z <= 5.6d-53) then
tmp = x + (y * (t / a))
else if (z <= 5.4d+44) then
tmp = t_1
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / z));
double tmp;
if (z <= -3.7e+87) {
tmp = x + t;
} else if (z <= -7500000.0) {
tmp = t_1;
} else if (z <= 5.6e-53) {
tmp = x + (y * (t / a));
} else if (z <= 5.4e+44) {
tmp = t_1;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (y / z)) tmp = 0 if z <= -3.7e+87: tmp = x + t elif z <= -7500000.0: tmp = t_1 elif z <= 5.6e-53: tmp = x + (y * (t / a)) elif z <= 5.4e+44: tmp = t_1 else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(y / z))) tmp = 0.0 if (z <= -3.7e+87) tmp = Float64(x + t); elseif (z <= -7500000.0) tmp = t_1; elseif (z <= 5.6e-53) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 5.4e+44) tmp = t_1; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (y / z)); tmp = 0.0; if (z <= -3.7e+87) tmp = x + t; elseif (z <= -7500000.0) tmp = t_1; elseif (z <= 5.6e-53) tmp = x + (y * (t / a)); elseif (z <= 5.4e+44) tmp = t_1; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+87], N[(x + t), $MachinePrecision], If[LessEqual[z, -7500000.0], t$95$1, If[LessEqual[z, 5.6e-53], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+44], t$95$1, N[(x + t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+87}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -7500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.70000000000000003e87 or 5.4e44 < z Initial program 72.0%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 84.8%
if -3.70000000000000003e87 < z < -7.5e6 or 5.59999999999999971e-53 < z < 5.4e44Initial program 92.3%
associate-/l*97.2%
Simplified97.2%
clear-num97.2%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in y around inf 75.4%
*-commutative75.4%
associate-*r/80.3%
Simplified80.3%
Taylor expanded in a around 0 69.5%
mul-1-neg69.5%
unsub-neg69.5%
associate-/l*74.4%
Simplified74.4%
if -7.5e6 < z < 5.59999999999999971e-53Initial program 96.0%
associate-/l*95.9%
Simplified95.9%
clear-num95.8%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in z around 0 79.3%
associate-*l/81.6%
*-commutative81.6%
Simplified81.6%
Final simplification81.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ t z)))))
(if (<= z -5e+85)
(+ x t)
(if (<= z -1600000.0)
t_1
(if (<= z 5e-53) (+ x (* y (/ t a))) (if (<= z 7e+43) t_1 (+ x t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (t / z));
double tmp;
if (z <= -5e+85) {
tmp = x + t;
} else if (z <= -1600000.0) {
tmp = t_1;
} else if (z <= 5e-53) {
tmp = x + (y * (t / a));
} else if (z <= 7e+43) {
tmp = t_1;
} else {
tmp = x + 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) :: t_1
real(8) :: tmp
t_1 = x - (y * (t / z))
if (z <= (-5d+85)) then
tmp = x + t
else if (z <= (-1600000.0d0)) then
tmp = t_1
else if (z <= 5d-53) then
tmp = x + (y * (t / a))
else if (z <= 7d+43) then
tmp = t_1
else
tmp = x + t
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 * (t / z));
double tmp;
if (z <= -5e+85) {
tmp = x + t;
} else if (z <= -1600000.0) {
tmp = t_1;
} else if (z <= 5e-53) {
tmp = x + (y * (t / a));
} else if (z <= 7e+43) {
tmp = t_1;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (t / z)) tmp = 0 if z <= -5e+85: tmp = x + t elif z <= -1600000.0: tmp = t_1 elif z <= 5e-53: tmp = x + (y * (t / a)) elif z <= 7e+43: tmp = t_1 else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(t / z))) tmp = 0.0 if (z <= -5e+85) tmp = Float64(x + t); elseif (z <= -1600000.0) tmp = t_1; elseif (z <= 5e-53) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 7e+43) tmp = t_1; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (t / z)); tmp = 0.0; if (z <= -5e+85) tmp = x + t; elseif (z <= -1600000.0) tmp = t_1; elseif (z <= 5e-53) tmp = x + (y * (t / a)); elseif (z <= 7e+43) tmp = t_1; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+85], N[(x + t), $MachinePrecision], If[LessEqual[z, -1600000.0], t$95$1, If[LessEqual[z, 5e-53], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+43], t$95$1, N[(x + t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+85}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1600000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -5.0000000000000001e85 or 7.0000000000000002e43 < z Initial program 72.0%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 84.8%
if -5.0000000000000001e85 < z < -1.6e6 or 5e-53 < z < 7.0000000000000002e43Initial program 92.3%
associate-/l*97.2%
Simplified97.2%
clear-num97.2%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in y around inf 75.4%
*-commutative75.4%
associate-*r/80.3%
Simplified80.3%
Taylor expanded in a around 0 74.4%
mul-1-neg74.4%
distribute-neg-frac274.4%
Simplified74.4%
if -1.6e6 < z < 5e-53Initial program 96.0%
associate-/l*95.9%
Simplified95.9%
clear-num95.8%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in z around 0 79.3%
associate-*l/81.6%
*-commutative81.6%
Simplified81.6%
Final simplification81.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e-74)
(+ x t)
(if (<= z 2.4e-222)
(* y (/ t a))
(if (<= z 3.9e-103) x (if (<= z 4.7e-67) (/ y (/ a t)) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-74) {
tmp = x + t;
} else if (z <= 2.4e-222) {
tmp = y * (t / a);
} else if (z <= 3.9e-103) {
tmp = x;
} else if (z <= 4.7e-67) {
tmp = y / (a / t);
} else {
tmp = x + 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.5d-74)) then
tmp = x + t
else if (z <= 2.4d-222) then
tmp = y * (t / a)
else if (z <= 3.9d-103) then
tmp = x
else if (z <= 4.7d-67) then
tmp = y / (a / t)
else
tmp = x + 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.5e-74) {
tmp = x + t;
} else if (z <= 2.4e-222) {
tmp = y * (t / a);
} else if (z <= 3.9e-103) {
tmp = x;
} else if (z <= 4.7e-67) {
tmp = y / (a / t);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e-74: tmp = x + t elif z <= 2.4e-222: tmp = y * (t / a) elif z <= 3.9e-103: tmp = x elif z <= 4.7e-67: tmp = y / (a / t) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e-74) tmp = Float64(x + t); elseif (z <= 2.4e-222) tmp = Float64(y * Float64(t / a)); elseif (z <= 3.9e-103) tmp = x; elseif (z <= 4.7e-67) tmp = Float64(y / Float64(a / t)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e-74) tmp = x + t; elseif (z <= 2.4e-222) tmp = y * (t / a); elseif (z <= 3.9e-103) tmp = x; elseif (z <= 4.7e-67) tmp = y / (a / t); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e-74], N[(x + t), $MachinePrecision], If[LessEqual[z, 2.4e-222], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e-103], x, If[LessEqual[z, 4.7e-67], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-74}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-222}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-103}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-67}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -5.5000000000000001e-74 or 4.70000000000000004e-67 < z Initial program 79.3%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 70.1%
if -5.5000000000000001e-74 < z < 2.39999999999999993e-222Initial program 98.5%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around 0 85.8%
Taylor expanded in y around inf 77.7%
Taylor expanded in t around inf 52.7%
if 2.39999999999999993e-222 < z < 3.9000000000000002e-103Initial program 99.9%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in x around inf 57.9%
if 3.9000000000000002e-103 < z < 4.70000000000000004e-67Initial program 73.5%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in z around 0 73.5%
Taylor expanded in y around inf 99.6%
Taylor expanded in t around inf 72.2%
clear-num72.0%
div-inv72.4%
Applied egg-rr72.4%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.4e+84) (not (<= z 6.8e+113))) (+ x t) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.4e+84) || !(z <= 6.8e+113)) {
tmp = x + t;
} else {
tmp = x - (y * (t / (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 <= (-4.4d+84)) .or. (.not. (z <= 6.8d+113))) then
tmp = x + t
else
tmp = x - (y * (t / (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 <= -4.4e+84) || !(z <= 6.8e+113)) {
tmp = x + t;
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.4e+84) or not (z <= 6.8e+113): tmp = x + t else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.4e+84) || !(z <= 6.8e+113)) tmp = Float64(x + t); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.4e+84) || ~((z <= 6.8e+113))) tmp = x + t; else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.4e+84], N[Not[LessEqual[z, 6.8e+113]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+84} \lor \neg \left(z \leq 6.8 \cdot 10^{+113}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -4.3999999999999997e84 or 6.80000000000000038e113 < z Initial program 67.8%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in z around inf 88.0%
if -4.3999999999999997e84 < z < 6.80000000000000038e113Initial program 95.5%
associate-/l*96.5%
Simplified96.5%
clear-num96.4%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in y around inf 82.4%
*-commutative82.4%
associate-*r/83.9%
Simplified83.9%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e+86) (not (<= z 2.2e+110))) (+ x t) (- x (/ y (/ (- z a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e+86) || !(z <= 2.2e+110)) {
tmp = x + t;
} else {
tmp = x - (y / ((z - 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 <= (-1.85d+86)) .or. (.not. (z <= 2.2d+110))) then
tmp = x + t
else
tmp = x - (y / ((z - 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 <= -1.85e+86) || !(z <= 2.2e+110)) {
tmp = x + t;
} else {
tmp = x - (y / ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e+86) or not (z <= 2.2e+110): tmp = x + t else: tmp = x - (y / ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e+86) || !(z <= 2.2e+110)) tmp = Float64(x + t); else tmp = Float64(x - Float64(y / Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.85e+86) || ~((z <= 2.2e+110))) tmp = x + t; else tmp = x - (y / ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e+86], N[Not[LessEqual[z, 2.2e+110]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+86} \lor \neg \left(z \leq 2.2 \cdot 10^{+110}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{z - a}{t}}\\
\end{array}
\end{array}
if z < -1.84999999999999996e86 or 2.19999999999999992e110 < z Initial program 67.8%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in z around inf 88.0%
if -1.84999999999999996e86 < z < 2.19999999999999992e110Initial program 95.5%
associate-/l*96.5%
Simplified96.5%
clear-num96.4%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in y around inf 82.4%
*-commutative82.4%
associate-*r/83.9%
Simplified83.9%
clear-num83.9%
un-div-inv84.3%
Applied egg-rr84.3%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.05e-96) (- x (* y (/ t (- z a)))) (if (<= y 5.4e+72) (+ x (* t (/ z (- z a)))) (- x (/ y (/ (- z a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.05e-96) {
tmp = x - (y * (t / (z - a)));
} else if (y <= 5.4e+72) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x - (y / ((z - 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 (y <= (-1.05d-96)) then
tmp = x - (y * (t / (z - a)))
else if (y <= 5.4d+72) then
tmp = x + (t * (z / (z - a)))
else
tmp = x - (y / ((z - 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 (y <= -1.05e-96) {
tmp = x - (y * (t / (z - a)));
} else if (y <= 5.4e+72) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x - (y / ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.05e-96: tmp = x - (y * (t / (z - a))) elif y <= 5.4e+72: tmp = x + (t * (z / (z - a))) else: tmp = x - (y / ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.05e-96) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); elseif (y <= 5.4e+72) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(y / Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.05e-96) tmp = x - (y * (t / (z - a))); elseif (y <= 5.4e+72) tmp = x + (t * (z / (z - a))); else tmp = x - (y / ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.05e-96], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e+72], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-96}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+72}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{z - a}{t}}\\
\end{array}
\end{array}
if y < -1.05000000000000001e-96Initial program 84.7%
associate-/l*97.8%
Simplified97.8%
clear-num97.7%
un-div-inv97.8%
Applied egg-rr97.8%
Taylor expanded in y around inf 81.5%
*-commutative81.5%
associate-*r/85.4%
Simplified85.4%
if -1.05000000000000001e-96 < y < 5.4000000000000001e72Initial program 86.9%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in y around 0 78.0%
mul-1-neg78.0%
unsub-neg78.0%
associate-/l*90.5%
Simplified90.5%
if 5.4000000000000001e72 < y Initial program 86.5%
associate-/l*99.8%
Simplified99.8%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 82.7%
*-commutative82.7%
associate-*r/91.0%
Simplified91.0%
clear-num90.9%
un-div-inv91.0%
Applied egg-rr91.0%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -12.5) (not (<= z 5600000000000.0))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -12.5) || !(z <= 5600000000000.0)) {
tmp = x + t;
} 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 <= (-12.5d0)) .or. (.not. (z <= 5600000000000.0d0))) then
tmp = x + t
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 <= -12.5) || !(z <= 5600000000000.0)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -12.5) or not (z <= 5600000000000.0): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -12.5) || !(z <= 5600000000000.0)) tmp = Float64(x + t); 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 <= -12.5) || ~((z <= 5600000000000.0))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -12.5], N[Not[LessEqual[z, 5600000000000.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -12.5 \lor \neg \left(z \leq 5600000000000\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -12.5 or 5.6e12 < z Initial program 74.7%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in z around inf 77.3%
if -12.5 < z < 5.6e12Initial program 95.8%
associate-/l*96.4%
Simplified96.4%
clear-num96.3%
un-div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in z around 0 76.0%
associate-*l/78.7%
*-commutative78.7%
Simplified78.7%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e-74) (not (<= z 2.4e-256))) (+ x t) (* y (/ t a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-74) || !(z <= 2.4e-256)) {
tmp = x + t;
} else {
tmp = 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.5d-74)) .or. (.not. (z <= 2.4d-256))) then
tmp = x + t
else
tmp = 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.5e-74) || !(z <= 2.4e-256)) {
tmp = x + t;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e-74) or not (z <= 2.4e-256): tmp = x + t else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e-74) || !(z <= 2.4e-256)) tmp = Float64(x + t); else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.5e-74) || ~((z <= 2.4e-256))) tmp = x + t; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-74], N[Not[LessEqual[z, 2.4e-256]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-74} \lor \neg \left(z \leq 2.4 \cdot 10^{-256}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.4999999999999999e-74 or 2.3999999999999999e-256 < z Initial program 82.0%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 65.3%
if -4.4999999999999999e-74 < z < 2.3999999999999999e-256Initial program 98.3%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in z around 0 86.0%
Taylor expanded in y around inf 80.1%
Taylor expanded in t around inf 54.3%
Final simplification62.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e-171) (not (<= z 2.5e-220))) (+ x t) (/ (* y t) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e-171) || !(z <= 2.5e-220)) {
tmp = x + t;
} else {
tmp = (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.1d-171)) .or. (.not. (z <= 2.5d-220))) then
tmp = x + t
else
tmp = (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.1e-171) || !(z <= 2.5e-220)) {
tmp = x + t;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e-171) or not (z <= 2.5e-220): tmp = x + t else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e-171) || !(z <= 2.5e-220)) tmp = Float64(x + t); else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e-171) || ~((z <= 2.5e-220))) tmp = x + t; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e-171], N[Not[LessEqual[z, 2.5e-220]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-171} \lor \neg \left(z \leq 2.5 \cdot 10^{-220}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.1000000000000001e-171 or 2.5000000000000001e-220 < z Initial program 82.6%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 63.9%
if -1.1000000000000001e-171 < z < 2.5000000000000001e-220Initial program 99.8%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around 0 91.7%
Taylor expanded in y around inf 84.4%
Taylor expanded in t around inf 56.7%
associate-*r/58.4%
Applied egg-rr58.4%
Final simplification62.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.9e+117) x (if (<= a 4e+16) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.9e+117) {
tmp = x;
} else if (a <= 4e+16) {
tmp = x + t;
} 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 <= (-3.9d+117)) then
tmp = x
else if (a <= 4d+16) then
tmp = x + t
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 <= -3.9e+117) {
tmp = x;
} else if (a <= 4e+16) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.9e+117: tmp = x elif a <= 4e+16: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.9e+117) tmp = x; elseif (a <= 4e+16) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.9e+117) tmp = x; elseif (a <= 4e+16) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.9e+117], x, If[LessEqual[a, 4e+16], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{+117}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+16}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.8999999999999999e117 or 4e16 < a Initial program 86.4%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around inf 62.0%
if -3.8999999999999999e117 < a < 4e16Initial program 85.8%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 59.7%
Final simplification60.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(Float64(y - z) * Float64(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[(N[(y - z), $MachinePrecision] * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(y - z\right) \cdot \frac{t}{z - a}
\end{array}
Initial program 86.0%
associate-/l*96.5%
Simplified96.5%
Final simplification96.5%
(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 86.0%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in x around inf 45.2%
Final simplification45.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (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 - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (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 - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024071
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))