
(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 13 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 99.1%
clear-num99.1%
un-div-inv99.3%
Applied egg-rr99.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.7e+114)
(+ x y)
(if (<= t 4.8e-45)
(+ x (/ y (/ a z)))
(if (<= t 2e+153) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.7e+114) {
tmp = x + y;
} else if (t <= 4.8e-45) {
tmp = x + (y / (a / z));
} else if (t <= 2e+153) {
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 <= (-8.7d+114)) then
tmp = x + y
else if (t <= 4.8d-45) then
tmp = x + (y / (a / z))
else if (t <= 2d+153) 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 <= -8.7e+114) {
tmp = x + y;
} else if (t <= 4.8e-45) {
tmp = x + (y / (a / z));
} else if (t <= 2e+153) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.7e+114: tmp = x + y elif t <= 4.8e-45: tmp = x + (y / (a / z)) elif t <= 2e+153: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.7e+114) tmp = Float64(x + y); elseif (t <= 4.8e-45) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 2e+153) 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 <= -8.7e+114) tmp = x + y; elseif (t <= 4.8e-45) tmp = x + (y / (a / z)); elseif (t <= 2e+153) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.7e+114], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.8e-45], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+153], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.7 \cdot 10^{+114}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-45}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+153}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -8.7000000000000001e114 or 2e153 < t Initial program 100.0%
Taylor expanded in t around inf 87.7%
+-commutative87.7%
Simplified87.7%
if -8.7000000000000001e114 < t < 4.7999999999999998e-45Initial program 98.3%
clear-num98.2%
un-div-inv98.5%
Applied egg-rr98.5%
Taylor expanded in t around 0 84.6%
if 4.7999999999999998e-45 < t < 2e153Initial program 99.8%
Taylor expanded in z around inf 77.1%
associate-/l*80.7%
Simplified80.7%
Taylor expanded in a around 0 71.0%
mul-1-neg71.0%
unsub-neg71.0%
associate-/l*71.1%
Simplified71.1%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.1e+35) (not (<= t 8.5e+150))) (+ 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 <= -1.1e+35) || !(t <= 8.5e+150)) {
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 <= (-1.1d+35)) .or. (.not. (t <= 8.5d+150))) 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 <= -1.1e+35) || !(t <= 8.5e+150)) {
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 <= -1.1e+35) or not (t <= 8.5e+150): 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 <= -1.1e+35) || !(t <= 8.5e+150)) 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 <= -1.1e+35) || ~((t <= 8.5e+150))) 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, -1.1e+35], N[Not[LessEqual[t, 8.5e+150]], $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 -1.1 \cdot 10^{+35} \lor \neg \left(t \leq 8.5 \cdot 10^{+150}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.0999999999999999e35 or 8.4999999999999999e150 < t Initial program 100.0%
Taylor expanded in z around 0 64.6%
+-commutative64.6%
associate-*r/64.6%
mul-1-neg64.6%
distribute-lft-neg-out64.6%
*-commutative64.6%
*-lft-identity64.6%
times-frac93.5%
/-rgt-identity93.5%
distribute-neg-frac93.5%
distribute-neg-frac293.5%
neg-sub093.5%
sub-neg93.5%
+-commutative93.5%
associate--r+93.5%
neg-sub093.5%
remove-double-neg93.5%
Simplified93.5%
if -1.0999999999999999e35 < t < 8.4999999999999999e150Initial program 98.7%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in z around inf 88.9%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e+157) (not (<= t 7.2e+155))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e+157) || !(t <= 7.2e+155)) {
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 <= (-1.6d+157)) .or. (.not. (t <= 7.2d+155))) 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 <= -1.6e+157) || !(t <= 7.2e+155)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.6e+157) or not (t <= 7.2e+155): tmp = x + y else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e+157) || !(t <= 7.2e+155)) 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 <= -1.6e+157) || ~((t <= 7.2e+155))) 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, -1.6e+157], N[Not[LessEqual[t, 7.2e+155]], $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 -1.6 \cdot 10^{+157} \lor \neg \left(t \leq 7.2 \cdot 10^{+155}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.6e157 or 7.20000000000000015e155 < t Initial program 100.0%
Taylor expanded in t around inf 90.0%
+-commutative90.0%
Simplified90.0%
if -1.6e157 < t < 7.20000000000000015e155Initial program 98.8%
clear-num98.8%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in z around inf 87.4%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.2e+157) (not (<= t 2.3e+151))) (+ x y) (- x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e+157) || !(t <= 2.3e+151)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (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 <= (-1.2d+157)) .or. (.not. (t <= 2.3d+151))) then
tmp = x + y
else
tmp = x - (y * (z / (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 <= -1.2e+157) || !(t <= 2.3e+151)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.2e+157) or not (t <= 2.3e+151): tmp = x + y else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.2e+157) || !(t <= 2.3e+151)) tmp = Float64(x + y); else tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.2e+157) || ~((t <= 2.3e+151))) tmp = x + y; else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.2e+157], N[Not[LessEqual[t, 2.3e+151]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+157} \lor \neg \left(t \leq 2.3 \cdot 10^{+151}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -1.2e157 or 2.3000000000000001e151 < t Initial program 100.0%
Taylor expanded in t around inf 90.0%
+-commutative90.0%
Simplified90.0%
if -1.2e157 < t < 2.3000000000000001e151Initial program 98.8%
Taylor expanded in z around inf 81.1%
associate-/l*87.2%
Simplified87.2%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.7e+35) (+ x (* y (/ t (- t a)))) (if (<= t 9.5e+150) (+ x (/ y (/ (- a t) z))) (+ x (/ y (/ (- t a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e+35) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 9.5e+150) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y / ((t - 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 (t <= (-1.7d+35)) then
tmp = x + (y * (t / (t - a)))
else if (t <= 9.5d+150) then
tmp = x + (y / ((a - t) / z))
else
tmp = x + (y / ((t - 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 (t <= -1.7e+35) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 9.5e+150) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y / ((t - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.7e+35: tmp = x + (y * (t / (t - a))) elif t <= 9.5e+150: tmp = x + (y / ((a - t) / z)) else: tmp = x + (y / ((t - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e+35) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 9.5e+150) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.7e+35) tmp = x + (y * (t / (t - a))); elseif (t <= 9.5e+150) tmp = x + (y / ((a - t) / z)); else tmp = x + (y / ((t - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e+35], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+150], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+35}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+150}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\end{array}
\end{array}
if t < -1.7000000000000001e35Initial program 99.9%
Taylor expanded in z around 0 64.2%
+-commutative64.2%
associate-*r/64.2%
mul-1-neg64.2%
distribute-lft-neg-out64.2%
*-commutative64.2%
*-lft-identity64.2%
times-frac90.3%
/-rgt-identity90.3%
distribute-neg-frac90.3%
distribute-neg-frac290.3%
neg-sub090.3%
sub-neg90.3%
+-commutative90.3%
associate--r+90.3%
neg-sub090.3%
remove-double-neg90.3%
Simplified90.3%
if -1.7000000000000001e35 < t < 9.5000000000000001e150Initial program 98.7%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in z around inf 88.9%
if 9.5000000000000001e150 < t Initial program 100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 98.2%
associate-*r/98.2%
neg-mul-198.2%
Simplified98.2%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.85e+117) (not (<= t 8.0))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.85e+117) || !(t <= 8.0)) {
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 <= (-2.85d+117)) .or. (.not. (t <= 8.0d0))) 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 <= -2.85e+117) || !(t <= 8.0)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.85e+117) or not (t <= 8.0): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.85e+117) || !(t <= 8.0)) 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 <= -2.85e+117) || ~((t <= 8.0))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.85e+117], N[Not[LessEqual[t, 8.0]], $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 -2.85 \cdot 10^{+117} \lor \neg \left(t \leq 8\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.85000000000000012e117 or 8 < t Initial program 99.9%
Taylor expanded in t around inf 78.0%
+-commutative78.0%
Simplified78.0%
if -2.85000000000000012e117 < t < 8Initial program 98.4%
clear-num98.3%
un-div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in t around 0 82.7%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.55e+115) (not (<= t 16.0))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.55e+115) || !(t <= 16.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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 <= (-3.55d+115)) .or. (.not. (t <= 16.0d0))) then
tmp = x + y
else
tmp = x + (z * (y / 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 <= -3.55e+115) || !(t <= 16.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.55e+115) or not (t <= 16.0): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.55e+115) || !(t <= 16.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.55e+115) || ~((t <= 16.0))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.55e+115], N[Not[LessEqual[t, 16.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.55 \cdot 10^{+115} \lor \neg \left(t \leq 16\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.5499999999999998e115 or 16 < t Initial program 99.9%
Taylor expanded in t around inf 78.0%
+-commutative78.0%
Simplified78.0%
if -3.5499999999999998e115 < t < 16Initial program 98.4%
clear-num98.3%
un-div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in z around inf 90.6%
associate-/r/90.4%
Applied egg-rr90.4%
Taylor expanded in a around inf 82.3%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (<= y 1.6e+215) (+ x y) (* t (/ y (- a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.6e+215) {
tmp = x + y;
} else {
tmp = t * (y / -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 (y <= 1.6d+215) then
tmp = x + y
else
tmp = t * (y / -a)
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.6e+215) {
tmp = x + y;
} else {
tmp = t * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 1.6e+215: tmp = x + y else: tmp = t * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.6e+215) tmp = Float64(x + y); else tmp = Float64(t * Float64(y / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 1.6e+215) tmp = x + y; else tmp = t * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.6e+215], N[(x + y), $MachinePrecision], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{+215}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if y < 1.5999999999999999e215Initial program 99.0%
Taylor expanded in t around inf 64.7%
+-commutative64.7%
Simplified64.7%
if 1.5999999999999999e215 < y Initial program 99.9%
Taylor expanded in a around inf 57.2%
Taylor expanded in z around 0 28.6%
mul-1-neg28.6%
unsub-neg28.6%
associate-/l*62.9%
Simplified62.9%
Taylor expanded in x around 0 13.8%
mul-1-neg13.8%
associate-*r/44.7%
*-commutative44.7%
distribute-rgt-neg-in44.7%
Simplified44.7%
Final simplification62.6%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- z t) (- t a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((z - t) / (t - 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) / (t - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((z - t) / (t - a)));
}
def code(x, y, z, t, a): return x - (y * ((z - t) / (t - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(z - t) / Float64(t - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((z - t) / (t - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{z - t}{t - a}
\end{array}
Initial program 99.1%
Final simplification99.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.75e+96) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.75e+96) {
tmp = 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 (y <= (-1.75d+96)) then
tmp = 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 (y <= -1.75e+96) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.75e+96: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.75e+96) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.75e+96) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.75e+96], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+96}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.7499999999999999e96Initial program 99.9%
Taylor expanded in t around inf 37.1%
+-commutative37.1%
Simplified37.1%
Taylor expanded in y around inf 30.7%
if -1.7499999999999999e96 < y Initial program 99.0%
Taylor expanded in x around inf 59.2%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 99.1%
Taylor expanded in t around inf 60.9%
+-commutative60.9%
Simplified60.9%
Final simplification60.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 99.1%
Taylor expanded in x around inf 50.6%
(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 2024116
(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)))))