
(FPCore (x y z) :precision binary64 (+ (* x y) (* (- x 1.0) z)))
double code(double x, double y, double z) {
return (x * y) + ((x - 1.0) * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) + ((x - 1.0d0) * z)
end function
public static double code(double x, double y, double z) {
return (x * y) + ((x - 1.0) * z);
}
def code(x, y, z): return (x * y) + ((x - 1.0) * z)
function code(x, y, z) return Float64(Float64(x * y) + Float64(Float64(x - 1.0) * z)) end
function tmp = code(x, y, z) tmp = (x * y) + ((x - 1.0) * z); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(N[(x - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y + \left(x - 1\right) \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (* x y) (* (- x 1.0) z)))
double code(double x, double y, double z) {
return (x * y) + ((x - 1.0) * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) + ((x - 1.0d0) * z)
end function
public static double code(double x, double y, double z) {
return (x * y) + ((x - 1.0) * z);
}
def code(x, y, z): return (x * y) + ((x - 1.0) * z)
function code(x, y, z) return Float64(Float64(x * y) + Float64(Float64(x - 1.0) * z)) end
function tmp = code(x, y, z) tmp = (x * y) + ((x - 1.0) * z); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(N[(x - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y + \left(x - 1\right) \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (fma x (+ y z) (- z)))
double code(double x, double y, double z) {
return fma(x, (y + z), -z);
}
function code(x, y, z) return fma(x, Float64(y + z), Float64(-z)) end
code[x_, y_, z_] := N[(x * N[(y + z), $MachinePrecision] + (-z)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y + z, -z\right)
\end{array}
Initial program 98.4%
*-commutative98.4%
distribute-rgt-out--98.4%
cancel-sign-sub-inv98.4%
metadata-eval98.4%
neg-mul-198.4%
associate-+r+98.4%
distribute-lft-out100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ y z))))
(if (<= x -2.65e-36)
t_0
(if (<= x 4.2e-120)
(- z)
(if (<= x 3.1e-37) (* x y) (if (<= x 0.084) (- z) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -2.65e-36) {
tmp = t_0;
} else if (x <= 4.2e-120) {
tmp = -z;
} else if (x <= 3.1e-37) {
tmp = x * y;
} else if (x <= 0.084) {
tmp = -z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (y + z)
if (x <= (-2.65d-36)) then
tmp = t_0
else if (x <= 4.2d-120) then
tmp = -z
else if (x <= 3.1d-37) then
tmp = x * y
else if (x <= 0.084d0) then
tmp = -z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -2.65e-36) {
tmp = t_0;
} else if (x <= 4.2e-120) {
tmp = -z;
} else if (x <= 3.1e-37) {
tmp = x * y;
} else if (x <= 0.084) {
tmp = -z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y + z) tmp = 0 if x <= -2.65e-36: tmp = t_0 elif x <= 4.2e-120: tmp = -z elif x <= 3.1e-37: tmp = x * y elif x <= 0.084: tmp = -z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y + z)) tmp = 0.0 if (x <= -2.65e-36) tmp = t_0; elseif (x <= 4.2e-120) tmp = Float64(-z); elseif (x <= 3.1e-37) tmp = Float64(x * y); elseif (x <= 0.084) tmp = Float64(-z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y + z); tmp = 0.0; if (x <= -2.65e-36) tmp = t_0; elseif (x <= 4.2e-120) tmp = -z; elseif (x <= 3.1e-37) tmp = x * y; elseif (x <= 0.084) tmp = -z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.65e-36], t$95$0, If[LessEqual[x, 4.2e-120], (-z), If[LessEqual[x, 3.1e-37], N[(x * y), $MachinePrecision], If[LessEqual[x, 0.084], (-z), t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -2.65 \cdot 10^{-36}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-120}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-37}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 0.084:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.6499999999999999e-36 or 0.0840000000000000052 < x Initial program 97.1%
Taylor expanded in x around inf 96.9%
+-commutative96.9%
Simplified96.9%
if -2.6499999999999999e-36 < x < 4.2000000000000001e-120 or 3.09999999999999993e-37 < x < 0.0840000000000000052Initial program 100.0%
Taylor expanded in x around 0 80.0%
neg-mul-180.0%
Simplified80.0%
if 4.2000000000000001e-120 < x < 3.09999999999999993e-37Initial program 99.8%
Taylor expanded in y around inf 81.6%
Final simplification89.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ y z))) (t_1 (* z (+ x -1.0))))
(if (<= x -1.52e-37)
t_0
(if (<= x 5.4e-120)
t_1
(if (<= x 2.75e-36) (* x y) (if (<= x 11500.0) t_1 t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (y + z);
double t_1 = z * (x + -1.0);
double tmp;
if (x <= -1.52e-37) {
tmp = t_0;
} else if (x <= 5.4e-120) {
tmp = t_1;
} else if (x <= 2.75e-36) {
tmp = x * y;
} else if (x <= 11500.0) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * (y + z)
t_1 = z * (x + (-1.0d0))
if (x <= (-1.52d-37)) then
tmp = t_0
else if (x <= 5.4d-120) then
tmp = t_1
else if (x <= 2.75d-36) then
tmp = x * y
else if (x <= 11500.0d0) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y + z);
double t_1 = z * (x + -1.0);
double tmp;
if (x <= -1.52e-37) {
tmp = t_0;
} else if (x <= 5.4e-120) {
tmp = t_1;
} else if (x <= 2.75e-36) {
tmp = x * y;
} else if (x <= 11500.0) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y + z) t_1 = z * (x + -1.0) tmp = 0 if x <= -1.52e-37: tmp = t_0 elif x <= 5.4e-120: tmp = t_1 elif x <= 2.75e-36: tmp = x * y elif x <= 11500.0: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y + z)) t_1 = Float64(z * Float64(x + -1.0)) tmp = 0.0 if (x <= -1.52e-37) tmp = t_0; elseif (x <= 5.4e-120) tmp = t_1; elseif (x <= 2.75e-36) tmp = Float64(x * y); elseif (x <= 11500.0) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y + z); t_1 = z * (x + -1.0); tmp = 0.0; if (x <= -1.52e-37) tmp = t_0; elseif (x <= 5.4e-120) tmp = t_1; elseif (x <= 2.75e-36) tmp = x * y; elseif (x <= 11500.0) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.52e-37], t$95$0, If[LessEqual[x, 5.4e-120], t$95$1, If[LessEqual[x, 2.75e-36], N[(x * y), $MachinePrecision], If[LessEqual[x, 11500.0], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + z\right)\\
t_1 := z \cdot \left(x + -1\right)\\
\mathbf{if}\;x \leq -1.52 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-36}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 11500:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.52e-37 or 11500 < x Initial program 97.0%
Taylor expanded in x around inf 97.8%
+-commutative97.8%
Simplified97.8%
if -1.52e-37 < x < 5.3999999999999997e-120 or 2.74999999999999992e-36 < x < 11500Initial program 100.0%
Taylor expanded in y around 0 80.3%
if 5.3999999999999997e-120 < x < 2.74999999999999992e-36Initial program 99.8%
Taylor expanded in y around inf 81.6%
Final simplification89.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ y z))))
(if (<= x -2.4e-36)
t_0
(if (<= x 5.4e-120)
(* z (+ x -1.0))
(if (<= x 4.3e-38) (* x y) (if (<= x 470000.0) (- (* x z) z) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -2.4e-36) {
tmp = t_0;
} else if (x <= 5.4e-120) {
tmp = z * (x + -1.0);
} else if (x <= 4.3e-38) {
tmp = x * y;
} else if (x <= 470000.0) {
tmp = (x * z) - z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (y + z)
if (x <= (-2.4d-36)) then
tmp = t_0
else if (x <= 5.4d-120) then
tmp = z * (x + (-1.0d0))
else if (x <= 4.3d-38) then
tmp = x * y
else if (x <= 470000.0d0) then
tmp = (x * z) - z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -2.4e-36) {
tmp = t_0;
} else if (x <= 5.4e-120) {
tmp = z * (x + -1.0);
} else if (x <= 4.3e-38) {
tmp = x * y;
} else if (x <= 470000.0) {
tmp = (x * z) - z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y + z) tmp = 0 if x <= -2.4e-36: tmp = t_0 elif x <= 5.4e-120: tmp = z * (x + -1.0) elif x <= 4.3e-38: tmp = x * y elif x <= 470000.0: tmp = (x * z) - z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y + z)) tmp = 0.0 if (x <= -2.4e-36) tmp = t_0; elseif (x <= 5.4e-120) tmp = Float64(z * Float64(x + -1.0)); elseif (x <= 4.3e-38) tmp = Float64(x * y); elseif (x <= 470000.0) tmp = Float64(Float64(x * z) - z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y + z); tmp = 0.0; if (x <= -2.4e-36) tmp = t_0; elseif (x <= 5.4e-120) tmp = z * (x + -1.0); elseif (x <= 4.3e-38) tmp = x * y; elseif (x <= 470000.0) tmp = (x * z) - z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.4e-36], t$95$0, If[LessEqual[x, 5.4e-120], N[(z * N[(x + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.3e-38], N[(x * y), $MachinePrecision], If[LessEqual[x, 470000.0], N[(N[(x * z), $MachinePrecision] - z), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{-36}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-120}:\\
\;\;\;\;z \cdot \left(x + -1\right)\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-38}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 470000:\\
\;\;\;\;x \cdot z - z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.4e-36 or 4.7e5 < x Initial program 97.0%
Taylor expanded in x around inf 97.8%
+-commutative97.8%
Simplified97.8%
if -2.4e-36 < x < 5.3999999999999997e-120Initial program 100.0%
Taylor expanded in y around 0 79.6%
if 5.3999999999999997e-120 < x < 4.3000000000000002e-38Initial program 99.8%
Taylor expanded in y around inf 81.6%
if 4.3000000000000002e-38 < x < 4.7e5Initial program 99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
neg-mul-199.8%
associate-+r+99.8%
unsub-neg99.8%
+-commutative99.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in y around 0 87.6%
Final simplification89.7%
(FPCore (x y z)
:precision binary64
(if (or (<= x -1.65e-35)
(not (or (<= x 5.4e-120) (and (not (<= x 2e-39)) (<= x 0.084)))))
(* x y)
(- z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.65e-35) || !((x <= 5.4e-120) || (!(x <= 2e-39) && (x <= 0.084)))) {
tmp = x * y;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.65d-35)) .or. (.not. (x <= 5.4d-120) .or. (.not. (x <= 2d-39)) .and. (x <= 0.084d0))) then
tmp = x * y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.65e-35) || !((x <= 5.4e-120) || (!(x <= 2e-39) && (x <= 0.084)))) {
tmp = x * y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.65e-35) or not ((x <= 5.4e-120) or (not (x <= 2e-39) and (x <= 0.084))): tmp = x * y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.65e-35) || !((x <= 5.4e-120) || (!(x <= 2e-39) && (x <= 0.084)))) tmp = Float64(x * y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.65e-35) || ~(((x <= 5.4e-120) || (~((x <= 2e-39)) && (x <= 0.084))))) tmp = x * y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.65e-35], N[Not[Or[LessEqual[x, 5.4e-120], And[N[Not[LessEqual[x, 2e-39]], $MachinePrecision], LessEqual[x, 0.084]]]], $MachinePrecision]], N[(x * y), $MachinePrecision], (-z)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-35} \lor \neg \left(x \leq 5.4 \cdot 10^{-120} \lor \neg \left(x \leq 2 \cdot 10^{-39}\right) \land x \leq 0.084\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if x < -1.65e-35 or 5.3999999999999997e-120 < x < 1.99999999999999986e-39 or 0.0840000000000000052 < x Initial program 97.3%
Taylor expanded in y around inf 54.8%
if -1.65e-35 < x < 5.3999999999999997e-120 or 1.99999999999999986e-39 < x < 0.0840000000000000052Initial program 100.0%
Taylor expanded in x around 0 80.0%
neg-mul-180.0%
Simplified80.0%
Final simplification65.0%
(FPCore (x y z)
:precision binary64
(if (<= x -9.4e-36)
(* x y)
(if (<= x 5.4e-120)
(- z)
(if (<= x 3.7e-39) (* x y) (if (<= x 0.35) (- z) (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.4e-36) {
tmp = x * y;
} else if (x <= 5.4e-120) {
tmp = -z;
} else if (x <= 3.7e-39) {
tmp = x * y;
} else if (x <= 0.35) {
tmp = -z;
} else {
tmp = x * z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9.4d-36)) then
tmp = x * y
else if (x <= 5.4d-120) then
tmp = -z
else if (x <= 3.7d-39) then
tmp = x * y
else if (x <= 0.35d0) then
tmp = -z
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9.4e-36) {
tmp = x * y;
} else if (x <= 5.4e-120) {
tmp = -z;
} else if (x <= 3.7e-39) {
tmp = x * y;
} else if (x <= 0.35) {
tmp = -z;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.4e-36: tmp = x * y elif x <= 5.4e-120: tmp = -z elif x <= 3.7e-39: tmp = x * y elif x <= 0.35: tmp = -z else: tmp = x * z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.4e-36) tmp = Float64(x * y); elseif (x <= 5.4e-120) tmp = Float64(-z); elseif (x <= 3.7e-39) tmp = Float64(x * y); elseif (x <= 0.35) tmp = Float64(-z); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.4e-36) tmp = x * y; elseif (x <= 5.4e-120) tmp = -z; elseif (x <= 3.7e-39) tmp = x * y; elseif (x <= 0.35) tmp = -z; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.4e-36], N[(x * y), $MachinePrecision], If[LessEqual[x, 5.4e-120], (-z), If[LessEqual[x, 3.7e-39], N[(x * y), $MachinePrecision], If[LessEqual[x, 0.35], (-z), N[(x * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{-36}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-120}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-39}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 0.35:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if x < -9.4000000000000006e-36 or 5.3999999999999997e-120 < x < 3.70000000000000015e-39Initial program 95.4%
Taylor expanded in y around inf 63.4%
if -9.4000000000000006e-36 < x < 5.3999999999999997e-120 or 3.70000000000000015e-39 < x < 0.34999999999999998Initial program 100.0%
Taylor expanded in x around 0 80.0%
neg-mul-180.0%
Simplified80.0%
if 0.34999999999999998 < x Initial program 100.0%
Taylor expanded in y around 0 61.5%
Taylor expanded in x around inf 58.7%
*-commutative58.7%
Simplified58.7%
Final simplification68.9%
(FPCore (x y z) :precision binary64 (- (* x (+ y z)) z))
double code(double x, double y, double z) {
return (x * (y + z)) - z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (y + z)) - z
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) - z;
}
def code(x, y, z): return (x * (y + z)) - z
function code(x, y, z) return Float64(Float64(x * Float64(y + z)) - z) end
function tmp = code(x, y, z) tmp = (x * (y + z)) - z; end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y + z\right) - z
\end{array}
Initial program 98.4%
*-commutative98.4%
distribute-rgt-out--98.4%
cancel-sign-sub-inv98.4%
metadata-eval98.4%
neg-mul-198.4%
associate-+r+98.4%
unsub-neg98.4%
+-commutative98.4%
distribute-lft-out100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (- z))
double code(double x, double y, double z) {
return -z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = -z
end function
public static double code(double x, double y, double z) {
return -z;
}
def code(x, y, z): return -z
function code(x, y, z) return Float64(-z) end
function tmp = code(x, y, z) tmp = -z; end
code[x_, y_, z_] := (-z)
\begin{array}{l}
\\
-z
\end{array}
Initial program 98.4%
Taylor expanded in x around 0 34.7%
neg-mul-134.7%
Simplified34.7%
Final simplification34.7%
herbie shell --seed 2024031
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Drawing:drawTextsR from Chart-1.5.3"
:precision binary64
(+ (* x y) (* (- x 1.0) z)))