
(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 10 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 (/ (- 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 99.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e+201) (* z (/ y a)) (if (<= z 180000.0) (+ x y) (if (<= z 1.75e+103) x (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+201) {
tmp = z * (y / a);
} else if (z <= 180000.0) {
tmp = x + y;
} else if (z <= 1.75e+103) {
tmp = x;
} else {
tmp = 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 (z <= (-1.1d+201)) then
tmp = z * (y / a)
else if (z <= 180000.0d0) then
tmp = x + y
else if (z <= 1.75d+103) then
tmp = x
else
tmp = 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 (z <= -1.1e+201) {
tmp = z * (y / a);
} else if (z <= 180000.0) {
tmp = x + y;
} else if (z <= 1.75e+103) {
tmp = x;
} else {
tmp = y * (z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+201: tmp = z * (y / a) elif z <= 180000.0: tmp = x + y elif z <= 1.75e+103: tmp = x else: tmp = y * (z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+201) tmp = Float64(z * Float64(y / a)); elseif (z <= 180000.0) tmp = Float64(x + y); elseif (z <= 1.75e+103) tmp = x; else tmp = Float64(y * Float64(z / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+201) tmp = z * (y / a); elseif (z <= 180000.0) tmp = x + y; elseif (z <= 1.75e+103) tmp = x; else tmp = y * (z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+201], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 180000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.75e+103], x, N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+201}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 180000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+103}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if z < -1.1e201Initial program 94.9%
Taylor expanded in t around 0
/-lowering-/.f6474.2%
Simplified74.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6457.9%
Simplified57.9%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6467.9%
Applied egg-rr67.9%
if -1.1e201 < z < 1.8e5Initial program 99.3%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6467.5%
Simplified67.5%
if 1.8e5 < z < 1.75e103Initial program 99.9%
Taylor expanded in x around inf
Simplified61.3%
if 1.75e103 < z Initial program 99.8%
Taylor expanded in t around 0
/-lowering-/.f6465.4%
Simplified65.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6433.8%
Simplified33.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6451.6%
Applied egg-rr51.6%
Final simplification64.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y a))))
(if (<= z -1.2e+202)
t_1
(if (<= z 1100000000.0) (+ x y) (if (<= z 5.2e+102) x t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / a);
double tmp;
if (z <= -1.2e+202) {
tmp = t_1;
} else if (z <= 1100000000.0) {
tmp = x + y;
} else if (z <= 5.2e+102) {
tmp = x;
} 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 = z * (y / a)
if (z <= (-1.2d+202)) then
tmp = t_1
else if (z <= 1100000000.0d0) then
tmp = x + y
else if (z <= 5.2d+102) then
tmp = x
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 = z * (y / a);
double tmp;
if (z <= -1.2e+202) {
tmp = t_1;
} else if (z <= 1100000000.0) {
tmp = x + y;
} else if (z <= 5.2e+102) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / a) tmp = 0 if z <= -1.2e+202: tmp = t_1 elif z <= 1100000000.0: tmp = x + y elif z <= 5.2e+102: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / a)) tmp = 0.0 if (z <= -1.2e+202) tmp = t_1; elseif (z <= 1100000000.0) tmp = Float64(x + y); elseif (z <= 5.2e+102) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / a); tmp = 0.0; if (z <= -1.2e+202) tmp = t_1; elseif (z <= 1100000000.0) tmp = x + y; elseif (z <= 5.2e+102) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+202], t$95$1, If[LessEqual[z, 1100000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 5.2e+102], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{a}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1100000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+102}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2000000000000001e202 or 5.20000000000000013e102 < z Initial program 98.3%
Taylor expanded in t around 0
/-lowering-/.f6468.2%
Simplified68.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6441.3%
Simplified41.3%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6455.2%
Applied egg-rr55.2%
if -1.2000000000000001e202 < z < 1.1e9Initial program 99.3%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6467.5%
Simplified67.5%
if 1.1e9 < z < 5.20000000000000013e102Initial program 99.9%
Taylor expanded in x around inf
Simplified61.3%
Final simplification63.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.1e-13) (+ x (* y (/ z a))) (if (<= a 2.8e-92) (- x (* y (+ -1.0 (/ z t)))) (+ x (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.1e-13) {
tmp = x + (y * (z / a));
} else if (a <= 2.8e-92) {
tmp = x - (y * (-1.0 + (z / t)));
} 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 (a <= (-6.1d-13)) then
tmp = x + (y * (z / a))
else if (a <= 2.8d-92) then
tmp = x - (y * ((-1.0d0) + (z / t)))
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 (a <= -6.1e-13) {
tmp = x + (y * (z / a));
} else if (a <= 2.8e-92) {
tmp = x - (y * (-1.0 + (z / t)));
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.1e-13: tmp = x + (y * (z / a)) elif a <= 2.8e-92: tmp = x - (y * (-1.0 + (z / t))) else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.1e-13) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (a <= 2.8e-92) tmp = Float64(x - Float64(y * Float64(-1.0 + Float64(z / t)))); 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 (a <= -6.1e-13) tmp = x + (y * (z / a)); elseif (a <= 2.8e-92) tmp = x - (y * (-1.0 + (z / t))); else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.1e-13], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e-92], N[(x - N[(y * N[(-1.0 + N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.1 \cdot 10^{-13}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-92}:\\
\;\;\;\;x - y \cdot \left(-1 + \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -6.1000000000000003e-13Initial program 99.9%
Taylor expanded in t around 0
/-lowering-/.f6491.3%
Simplified91.3%
if -6.1000000000000003e-13 < a < 2.8e-92Initial program 99.0%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6489.2%
Simplified89.2%
if 2.8e-92 < a Initial program 98.7%
Taylor expanded in t around 0
/-lowering-/.f6481.1%
Simplified81.1%
+-commutativeN/A
+-lowering-+.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6481.2%
Applied egg-rr81.2%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.8e+157) (+ x y) (if (<= t 1.8e-27) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e+157) {
tmp = x + y;
} else if (t <= 1.8e-27) {
tmp = x + (y / (a / 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 (t <= (-7.8d+157)) then
tmp = x + y
else if (t <= 1.8d-27) then
tmp = x + (y / (a / 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 (t <= -7.8e+157) {
tmp = x + y;
} else if (t <= 1.8e-27) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e+157: tmp = x + y elif t <= 1.8e-27: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e+157) tmp = Float64(x + y); elseif (t <= 1.8e-27) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.8e+157) tmp = x + y; elseif (t <= 1.8e-27) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e+157], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.8e-27], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+157}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-27}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.79999999999999941e157 or 1.7999999999999999e-27 < t Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6481.8%
Simplified81.8%
if -7.79999999999999941e157 < t < 1.7999999999999999e-27Initial program 98.6%
Taylor expanded in t around 0
/-lowering-/.f6479.8%
Simplified79.8%
+-commutativeN/A
+-lowering-+.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6479.8%
Applied egg-rr79.8%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.3e+190) (+ x y) (if (<= t 7.5e-31) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.3e+190) {
tmp = x + y;
} else if (t <= 7.5e-31) {
tmp = x + (y * (z / a));
} 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+190)) then
tmp = x + y
else if (t <= 7.5d-31) then
tmp = x + (y * (z / a))
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+190) {
tmp = x + y;
} else if (t <= 7.5e-31) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.3e+190: tmp = x + y elif t <= 7.5e-31: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.3e+190) tmp = Float64(x + y); elseif (t <= 7.5e-31) tmp = Float64(x + Float64(y * Float64(z / a))); 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+190) tmp = x + y; elseif (t <= 7.5e-31) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.3e+190], N[(x + y), $MachinePrecision], If[LessEqual[t, 7.5e-31], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+190}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-31}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.3e190 or 7.49999999999999975e-31 < t Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6482.5%
Simplified82.5%
if -3.3e190 < t < 7.49999999999999975e-31Initial program 98.7%
Taylor expanded in t around 0
/-lowering-/.f6479.5%
Simplified79.5%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* z (/ y (- a t))))) (if (<= z -2.3e+199) t_1 (if (<= z 2200000000000.0) (+ x y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (a - t));
double tmp;
if (z <= -2.3e+199) {
tmp = t_1;
} else if (z <= 2200000000000.0) {
tmp = x + y;
} 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 = z * (y / (a - t))
if (z <= (-2.3d+199)) then
tmp = t_1
else if (z <= 2200000000000.0d0) then
tmp = x + y
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 = z * (y / (a - t));
double tmp;
if (z <= -2.3e+199) {
tmp = t_1;
} else if (z <= 2200000000000.0) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / (a - t)) tmp = 0 if z <= -2.3e+199: tmp = t_1 elif z <= 2200000000000.0: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(a - t))) tmp = 0.0 if (z <= -2.3e+199) tmp = t_1; elseif (z <= 2200000000000.0) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / (a - t)); tmp = 0.0; if (z <= -2.3e+199) tmp = t_1; elseif (z <= 2200000000000.0) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+199], t$95$1, If[LessEqual[z, 2200000000000.0], N[(x + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{a - t}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2200000000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.29999999999999995e199 or 2.2e12 < z Initial program 98.7%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6451.1%
Simplified51.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6463.7%
Applied egg-rr63.7%
if -2.29999999999999995e199 < z < 2.2e12Initial program 99.4%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6467.7%
Simplified67.7%
Final simplification66.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.2e-40) (+ x y) (if (<= t 4.5e-49) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e-40) {
tmp = x + y;
} else if (t <= 4.5e-49) {
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 (t <= (-4.2d-40)) then
tmp = x + y
else if (t <= 4.5d-49) 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 (t <= -4.2e-40) {
tmp = x + y;
} else if (t <= 4.5e-49) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e-40: tmp = x + y elif t <= 4.5e-49: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e-40) tmp = Float64(x + y); elseif (t <= 4.5e-49) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e-40) tmp = x + y; elseif (t <= 4.5e-49) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e-40], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.5e-49], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-40}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.20000000000000036e-40 or 4.5000000000000002e-49 < t Initial program 99.9%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6475.2%
Simplified75.2%
if -4.20000000000000036e-40 < t < 4.5000000000000002e-49Initial program 98.3%
Taylor expanded in x around inf
Simplified43.3%
Final simplification60.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -6.8e-228) x (if (<= x 9.4e-215) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.8e-228) {
tmp = x;
} else if (x <= 9.4e-215) {
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 (x <= (-6.8d-228)) then
tmp = x
else if (x <= 9.4d-215) 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 (x <= -6.8e-228) {
tmp = x;
} else if (x <= 9.4e-215) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6.8e-228: tmp = x elif x <= 9.4e-215: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.8e-228) tmp = x; elseif (x <= 9.4e-215) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6.8e-228) tmp = x; elseif (x <= 9.4e-215) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.8e-228], x, If[LessEqual[x, 9.4e-215], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-228}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9.4 \cdot 10^{-215}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.79999999999999981e-228 or 9.399999999999999e-215 < x Initial program 99.0%
Taylor expanded in x around inf
Simplified55.6%
if -6.79999999999999981e-228 < x < 9.399999999999999e-215Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6481.0%
Simplified81.0%
Taylor expanded in t around inf
Simplified37.4%
(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
Simplified49.0%
(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 2024158
(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)))))