
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a z) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - z) / (t - 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 / ((a - z) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - z) / (t - z)));
}
def code(x, y, z, t, a): return x + (y / ((a - z) / (t - z)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - z) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - z) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - z}{t - z}}
\end{array}
Initial program 98.3%
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
cancel-sign-subN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
associate-*l/N/A
/-lowering-/.f64N/A
Simplified84.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.6%
Applied egg-rr98.6%
Final simplification98.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -5e-108) (+ x (* y (/ z (- z a)))) (if (<= z 4.4e-151) (+ x (* y (/ t a))) (- x (/ y (+ (/ a z) -1.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-108) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 4.4e-151) {
tmp = x + (y * (t / a));
} else {
tmp = x - (y / ((a / z) + -1.0));
}
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 <= (-5d-108)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 4.4d-151) then
tmp = x + (y * (t / a))
else
tmp = x - (y / ((a / z) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-108) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 4.4e-151) {
tmp = x + (y * (t / a));
} else {
tmp = x - (y / ((a / z) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5e-108: tmp = x + (y * (z / (z - a))) elif z <= 4.4e-151: tmp = x + (y * (t / a)) else: tmp = x - (y / ((a / z) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e-108) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 4.4e-151) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x - Float64(y / Float64(Float64(a / z) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5e-108) tmp = x + (y * (z / (z - a))); elseif (z <= 4.4e-151) tmp = x + (y * (t / a)); else tmp = x - (y / ((a / z) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-108], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e-151], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-108}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-151}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z} + -1}\\
\end{array}
\end{array}
if z < -5e-108Initial program 97.8%
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
cancel-sign-subN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
associate-*l/N/A
/-lowering-/.f64N/A
Simplified82.2%
Taylor expanded in t around 0
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6487.1%
Simplified87.1%
if -5e-108 < z < 4.3999999999999999e-151Initial program 96.9%
Taylor expanded in z around 0
/-lowering-/.f6484.0%
Simplified84.0%
if 4.3999999999999999e-151 < z Initial program 100.0%
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
cancel-sign-subN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
associate-*l/N/A
/-lowering-/.f64N/A
Simplified79.0%
Taylor expanded in t around 0
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6487.7%
Simplified87.7%
--lowering--.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6487.7%
Applied egg-rr87.7%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* y (/ z (- z a)))))) (if (<= z -2.7e-108) t_1 (if (<= z 1.35e-157) (+ x (* y (/ t a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -2.7e-108) {
tmp = t_1;
} else if (z <= 1.35e-157) {
tmp = x + (y * (t / a));
} 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 / (z - a)))
if (z <= (-2.7d-108)) then
tmp = t_1
else if (z <= 1.35d-157) then
tmp = x + (y * (t / a))
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 / (z - a)));
double tmp;
if (z <= -2.7e-108) {
tmp = t_1;
} else if (z <= 1.35e-157) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -2.7e-108: tmp = t_1 elif z <= 1.35e-157: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -2.7e-108) tmp = t_1; elseif (z <= 1.35e-157) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -2.7e-108) tmp = t_1; elseif (z <= 1.35e-157) tmp = x + (y * (t / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e-108], t$95$1, If[LessEqual[z, 1.35e-157], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-157}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.70000000000000005e-108 or 1.35e-157 < z Initial program 98.8%
*-commutativeN/A
associate-*l/N/A
associate-/l*N/A
cancel-sign-subN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
associate-*l/N/A
/-lowering-/.f64N/A
Simplified80.8%
Taylor expanded in t around 0
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6487.4%
Simplified87.4%
if -2.70000000000000005e-108 < z < 1.35e-157Initial program 96.9%
Taylor expanded in z around 0
/-lowering-/.f6484.0%
Simplified84.0%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.2e+26) (+ x (/ y (/ z (- z t)))) (if (<= z 1.45e-136) (+ x (* y (/ t a))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+26) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 1.45e-136) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * ((z - 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 (z <= (-3.2d+26)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 1.45d-136) then
tmp = x + (y * (t / a))
else
tmp = x + (y * ((z - 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 (z <= -3.2e+26) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 1.45e-136) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.2e+26: tmp = x + (y / (z / (z - t))) elif z <= 1.45e-136: tmp = x + (y * (t / a)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e+26) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 1.45e-136) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.2e+26) tmp = x + (y / (z / (z - t))); elseif (z <= 1.45e-136) tmp = x + (y * (t / a)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+26], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-136], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+26}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-136}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -3.20000000000000029e26Initial program 99.9%
Taylor expanded in z around inf
Simplified82.0%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6482.1%
Applied egg-rr82.1%
if -3.20000000000000029e26 < z < 1.44999999999999997e-136Initial program 95.8%
Taylor expanded in z around 0
/-lowering-/.f6480.2%
Simplified80.2%
if 1.44999999999999997e-136 < z Initial program 100.0%
Taylor expanded in z around inf
Simplified86.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* y (/ (- z t) z))))) (if (<= z -1.35e+28) t_1 (if (<= z 1.45e-136) (+ x (* y (/ t a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -1.35e+28) {
tmp = t_1;
} else if (z <= 1.45e-136) {
tmp = x + (y * (t / a));
} 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) / z))
if (z <= (-1.35d+28)) then
tmp = t_1
else if (z <= 1.45d-136) then
tmp = x + (y * (t / a))
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) / z));
double tmp;
if (z <= -1.35e+28) {
tmp = t_1;
} else if (z <= 1.45e-136) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / z)) tmp = 0 if z <= -1.35e+28: tmp = t_1 elif z <= 1.45e-136: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / z))) tmp = 0.0 if (z <= -1.35e+28) tmp = t_1; elseif (z <= 1.45e-136) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / z)); tmp = 0.0; if (z <= -1.35e+28) tmp = t_1; elseif (z <= 1.45e-136) tmp = x + (y * (t / a)); 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] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+28], t$95$1, If[LessEqual[z, 1.45e-136], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{z}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-136}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3500000000000001e28 or 1.44999999999999997e-136 < z Initial program 99.9%
Taylor expanded in z around inf
Simplified84.2%
if -1.3500000000000001e28 < z < 1.44999999999999997e-136Initial program 95.8%
Taylor expanded in z around 0
/-lowering-/.f6480.2%
Simplified80.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -60000000000.0) (+ x y) (if (<= z 1.4e-118) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -60000000000.0) {
tmp = x + y;
} else if (z <= 1.4e-118) {
tmp = x + (y * (t / 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 (z <= (-60000000000.0d0)) then
tmp = x + y
else if (z <= 1.4d-118) then
tmp = x + (y * (t / 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 (z <= -60000000000.0) {
tmp = x + y;
} else if (z <= 1.4e-118) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -60000000000.0: tmp = x + y elif z <= 1.4e-118: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -60000000000.0) tmp = Float64(x + y); elseif (z <= 1.4e-118) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -60000000000.0) tmp = x + y; elseif (z <= 1.4e-118) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -60000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.4e-118], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -60000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-118}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6e10 or 1.4e-118 < z Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6478.1%
Simplified78.1%
if -6e10 < z < 1.4e-118Initial program 95.7%
Taylor expanded in z around 0
/-lowering-/.f6478.5%
Simplified78.5%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.6e+183) x (if (<= a 4e+125) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e+183) {
tmp = x;
} else if (a <= 4e+125) {
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 <= (-2.6d+183)) then
tmp = x
else if (a <= 4d+125) 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 <= -2.6e+183) {
tmp = x;
} else if (a <= 4e+125) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.6e+183: tmp = x elif a <= 4e+125: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e+183) tmp = x; elseif (a <= 4e+125) 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 <= -2.6e+183) tmp = x; elseif (a <= 4e+125) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e+183], x, If[LessEqual[a, 4e+125], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+183}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+125}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.5999999999999999e183 or 3.9999999999999997e125 < a Initial program 99.3%
Taylor expanded in x around inf
Simplified70.5%
if -2.5999999999999999e183 < a < 3.9999999999999997e125Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6471.0%
Simplified71.0%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.2e-185) x (if (<= x 5.8e-119) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.2e-185) {
tmp = x;
} else if (x <= 5.8e-119) {
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 <= (-2.2d-185)) then
tmp = x
else if (x <= 5.8d-119) 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 <= -2.2e-185) {
tmp = x;
} else if (x <= 5.8e-119) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.2e-185: tmp = x elif x <= 5.8e-119: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.2e-185) tmp = x; elseif (x <= 5.8e-119) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.2e-185) tmp = x; elseif (x <= 5.8e-119) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.2e-185], x, If[LessEqual[x, 5.8e-119], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-185}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-119}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.2e-185 or 5.8e-119 < x Initial program 97.6%
Taylor expanded in x around inf
Simplified67.8%
if -2.2e-185 < x < 5.8e-119Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6444.5%
Simplified44.5%
Taylor expanded in y around inf
Simplified39.6%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.3%
(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.3%
Taylor expanded in x around inf
Simplified51.8%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024191
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))